我最近开始使用 python,并意识到这可能是一个愚蠢的问题,但我试图使用窗口制作基于选择的游戏。我曾经graphics.py显示我的文字。当我运行代码时,窗口打开但处于“无响应状态”,我无法找出问题所在。也没有错误代码
我基本上从 left peel 的视频中复制了所有内容。然而,视频是否已经过时,所以可能某处有错误,但没有更多的网站或视频可以解释graphics.py
这是代码:
from graphics import *
def main():
win = GraphWin("win", 1300, 700)
#win.setBackground(color_rgb(255, 0, 0))
txt = Text(Point(650, 120), 'This was text')
txt1 = Text(Point(650, 135), "This was text")
txt2 = Text(Point(650, 150), "This was text")
txt3 = Text(Point(650, 165), "This was text")
txt4 = Text(Point(650, 180), "This was text "
"This was text.")
img = Image(Point(650, 450), "a picture (.gif)")
nxt = Text(Point(1090, 590), "Type next for next")
txt.draw(win)
txt1.draw(win)
txt2.draw(win)
txt3.draw(win)
txt4.draw(win)
img.draw(win)
inputb = Entry(Point(1200, 590), 10)
inputb.draw(win)
nxt.draw(win)
s = inputb.getText()
command = inputb.getText()
while True:
s = inputb.getText()
if s == 'next':
the program stopped working from here, so i just put a print("")
main()
元芳怎么了
相关分类