![](/img/trans.png)
[英]Pygame is installed, but when I try to run my program the window won't open
[英]the tkinter window won't open when i run the program when i click on the shell
當我運行程序並單擊 python shell 時,Tkinter 窗口不會打開,當我運行程序時它運行良好,但是當我單擊 shell 上的任意位置時,Tkinter 窗口不會打開。 我的程序還有什么問題嗎。 非常感謝
from tkinter import *
import time
import pygame
import random
root = Tk()
root.geometry('350x200')
pygame.init()
e1={}
clicks = 0
def more():
Button(root, text='Submit', command=sumbit,bg='orange',height=3,width=5,cursor='target').grid(row=10, column=0)
global clicks
clicks=clicks +1
w1 = Entry(root)
w2 = Entry(root)
e1[w1] = w2
Label(root, text="Word",font='courier',fg='blue').grid(row=0,column=1)
Label(root, text="Definiton",font='courier',fg='red').grid(row=0, column=2)
w1.grid(row=2, column=1)
w2.grid(row=2, column=2)
root.mainloop()
我沒有安裝 pygame,但是我在沒有 pygame 的情況下運行了該程序,並且窗口打開得很好並且一直保持打開狀態,直到我手動關閉它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.