当前位置: 首页>>代码示例>>Python>>正文


Python Tk.wm_withdraw方法代码示例

本文整理汇总了Python中tkinter.Tk.wm_withdraw方法的典型用法代码示例。如果您正苦于以下问题:Python Tk.wm_withdraw方法的具体用法?Python Tk.wm_withdraw怎么用?Python Tk.wm_withdraw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tkinter.Tk的用法示例。


在下文中一共展示了Tk.wm_withdraw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Tk

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_withdraw [as 别名]
@license This software is free - http://www.gnu.org/licenses/gpl.html

@link    https://www.brython.info/static_doc/en/intro.html
@link    https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API
'''

from tkinter import Tk, messagebox, simpledialog
import subprocess, sys
try:
    import pygame
except:
    subprocess.call([sys.executable, "-m", "pip", "install", "pygame"])
    import pygame

_tkmain = Tk()
_tkmain.wm_withdraw() #to hide the main window
_ws, _hs = _tkmain.winfo_screenwidth(), _tkmain.winfo_screenheight()
_tkmain.geometry("100x100+%d+%d" % (_ws//2, _hs//2))

_canvas = None
_update, _keydown, _keyup = None, None, None
_color = (127, 127, 127)
_mouse_pos = (0, 0)
_mouse_codes = ["LeftButton", "MiddleButton", "RightButton"]

def init_canvas(size: (int, int)):
    '''Set size of first CANVAS and return it'''
    global _canvas
    pygame.init()
    _canvas = pygame.display.set_mode(size)
    clear_canvas()
开发者ID:tomamic,项目名称:fondinfo,代码行数:33,代码来源:g2d_pyg.py

示例2: getattr

# 需要导入模块: from tkinter import Tk [as 别名]
# 或者: from tkinter.Tk import wm_withdraw [as 别名]
from datetime import datetime, timedelta
from win32com.client import Dispatch
from tkinter import Tk
import tkinter.messagebox as mbox

curdir = None
if getattr(sys, 'frozen', False):
	# frozen
	curdir = path.dirname(sys.executable)
else:
	# unfrozen
	curdir = path.dirname(path.abspath(__file__))

mylabel = path.join(curdir,'my.label')
window = Tk()
window.wm_withdraw()

if not path.isfile(mylabel):
	mbox.showinfo('PyDymoLabel','Template file my.label does not exist')
	sys.exit(1)

try:
	now = datetime.now()
	next = now + timedelta(30)

	labelCom = Dispatch('Dymo.DymoAddIn')
	labelText = Dispatch('Dymo.DymoLabels')
	isOpen = labelCom.Open(mylabel)
	selectPrinter = 'DYMO LabelWriter 450'
	labelCom.SelectPrinter(selectPrinter)
开发者ID:BjornFJohansson,项目名称:PyDymoLabel,代码行数:32,代码来源:PyDymoLabel.py


注:本文中的tkinter.Tk.wm_withdraw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。