这个程序就动感多了,会随机出现弹窗。 import tkinter as tk import random import threading import time def boom: window = tk.Tk width = window.winfo_screenwidth height = window.winfo_screenheight a = random.randrange(0, width) b = random.randrange(0, height) window.title('你是一个傻狍子'...
import tkinter as tk import random import threading import time def boom(): window = tk.Tk() width = window.winfo_screenwidth() height = window.winfo_screenheight() a = random.randrange( 0, width) b = random.randrange( 0, height) window.title( '你是一个傻狍子') window.geometry( "...
import tkinter as tkwindow = tk.Tk()window.title('逃学联盟')window.configure(bg='#008CBA')window.resizable(True, True)window.minsize(100, 100)# window.maxsize(1000, 500)window.state('zoomed')window_width = 500window_height = 100screen_width = window.winfo_screenwidth()screen_height = ...
import tkinter as Tk ModuleNotFoundError: No module named 'tkinter'
请填写横线处代码,完成程序。 import tkinter as t #引入tkinter库,别名为t w=t.Tk() #创建一个主窗口 w.___('欢迎学习tkinter') #设置窗口的标题 w['width']=600 #设置窗口的宽度 w['height']=400 #设置窗口的高度 w['bg']='red' #设置窗口的背景颜色 w.mainloop...
在tkinter库中,我们可以通过使用窗口对象的title方法来设置窗口的标题。所以横线处的代码应该为:title 所以完整的代码应该如下: import tkinter as t # 引入 tkinter 库,别名为 t w=t.Tk() # 创建一个主窗口 w.title('欢迎学习tkinter') # 设置窗口的标题 w['width']=600 # 设置...
The question is should I be using import tkinter as Tk or import tkinter as tk? I'm thinking the latter but I would like to stick to industry standards. Also take into consideration how most answers are written in Stack Overflow. Going with this majority means I can try code snippets wit...
软件运行成功必有重谢 ```python import os import re import tkinter as tk from tkinter import filedialog, scrolledtext class SearchEngine: def __init__(self): pass def search(self, keyword, path): results = [] for root, dirs, files in os.walk(path): for file in files: filepath = ...
题目在窗体win中添加一个下拉列表import tkinter as tkfrom tkinter import ttkwin=tk.Tk()win=cb=___.___(win, width=12)___=('1','2','3','4') 相关知识点: 试题来源: 解析 (1)ttk(2)Combobox(3)cb['values']
try: import Tkinter as tk # this is for python2 except: import tkinter as tk # this is for python3 If this doesn't work, try reinstalling tkinter. If you don't know how to reinstall tkinter look at the tkinter installation page, here. Share Improve this answer Follow answered Oct ...