Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/285.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Tkinter没有运行程序 从tkinter导入* def raise_机架(机架): frame.tkraise() root=Tk() f1=帧(根) f2=帧(根) f3=帧(根) f4=帧(根) 对于帧输入(f1、f2、f3、f4): frame.grid(行=0,列=0,sticky='news') 按钮(f1,text='Go to frame 2',command=lambda:raise_frame(f2)).pack() 标签(f1,text='FRAME 1').pack() 标签(f2,text='FRAME 2').pack() 按钮(f2,text='Go to frame 3',command=lambda:raise_frame(f3)).pack() 标签(f3,text='FRAME 3')。包装(side='left') 按钮(f3,text='Go to frame 4',command=lambda:raise_frame(f4)).pack(side='left') 标签(f4,text='FRAME 4').pack() 按钮(f4,text='Goto to frame 1',command=lambda:raise_frame(f1)).pack() 提升框架(f1) root.mainloop_Python_User Interface_Tkinter - Fatal编程技术网

Python Tkinter没有运行程序 从tkinter导入* def raise_机架(机架): frame.tkraise() root=Tk() f1=帧(根) f2=帧(根) f3=帧(根) f4=帧(根) 对于帧输入(f1、f2、f3、f4): frame.grid(行=0,列=0,sticky='news') 按钮(f1,text='Go to frame 2',command=lambda:raise_frame(f2)).pack() 标签(f1,text='FRAME 1').pack() 标签(f2,text='FRAME 2').pack() 按钮(f2,text='Go to frame 3',command=lambda:raise_frame(f3)).pack() 标签(f3,text='FRAME 3')。包装(side='left') 按钮(f3,text='Go to frame 4',command=lambda:raise_frame(f4)).pack(side='left') 标签(f4,text='FRAME 4').pack() 按钮(f4,text='Goto to frame 1',command=lambda:raise_frame(f1)).pack() 提升框架(f1) root.mainloop

Python Tkinter没有运行程序 从tkinter导入* def raise_机架(机架): frame.tkraise() root=Tk() f1=帧(根) f2=帧(根) f3=帧(根) f4=帧(根) 对于帧输入(f1、f2、f3、f4): frame.grid(行=0,列=0,sticky='news') 按钮(f1,text='Go to frame 2',command=lambda:raise_frame(f2)).pack() 标签(f1,text='FRAME 1').pack() 标签(f2,text='FRAME 2').pack() 按钮(f2,text='Go to frame 3',command=lambda:raise_frame(f3)).pack() 标签(f3,text='FRAME 3')。包装(side='left') 按钮(f3,text='Go to frame 4',command=lambda:raise_frame(f4)).pack(side='left') 标签(f4,text='FRAME 4').pack() 按钮(f4,text='Goto to frame 1',command=lambda:raise_frame(f1)).pack() 提升框架(f1) root.mainloop,python,user-interface,tkinter,Python,User Interface,Tkinter,我可以运行其他代码,但此代码无法加载,我不知道为什么。最后一条语句没有调用mainloop-应该是: ... raise_frame(f1) root.mainloop() # Note `()` at end. 最后一条语句没有调用mainloop-它应该是: ... raise_frame(f1) root.mainloop() # Note `()` at end. 你在root.mainloop之后忘记了你的()你在root.mainloop之后忘记了你的(),哎呀,我应该在评论

我可以运行其他代码,但此代码无法加载,我不知道为什么。

最后一条语句没有调用
mainloop
-应该是:

...
raise_frame(f1)
root.mainloop()  # Note `()` at end.

最后一条语句没有调用
mainloop
-它应该是:

...
raise_frame(f1)
root.mainloop()  # Note `()` at end.

你在
root.mainloop
之后忘记了你的
()
你在
root.mainloop
之后忘记了你的
()
,哎呀,我应该在评论之前读一下答案@你可以删除你的评论…我倾向于把我的错误存档,作为对自己和他人的一个谦卑的警示故事。哎呀,我应该在评论之前阅读答案@你可以删除你的评论…我倾向于把我的错误作为一个谦卑的警示故事留给自己和他人。