GUI程序错误 [英] GUI Program Error

查看:79
本文介绍了GUI程序错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用学习编程。 GUI教程
http://www.freenetpages。 co.uk/hp/alan.gauld/

我正在尝试编写我的第一个GUI。但是,教程的代码

给出了一个窗口开始:

import Tkinter


top = Tkinter.Tk( )


dir(上)


不起作用。 Python解释器不会抱怨任何东西,

但教程承诺的窗口不会出现。我在Ubuntu 5.10上使用了

Python 2.4.2和Eric 3.7.0 IDE。有人知道

要做什么吗?


- / usr / bin / byte

Hi, I''m using the "Learning to Program" GUI tutorial on
http://www.freenetpages.co.uk/hp/alan.gauld/
and am trying to write my first GUI. However, the code the tutorial
gives for starting by making a window:
import Tkinter

top = Tkinter.Tk()

dir(top)

Does not work. The Python interpreter does not complain about anything,
but the window the tutorial promises will apperar will not. I''m using
Python 2.4.2 and the Eric 3.7.0 IDE on Ubuntu 5.10. Anybody know what
to do?

-- /usr/bin/byte

推荐答案

Byte写道:
我正在使用学习编程。 GUI教程
http://www.freenetpages。 co.uk/hp/alan.gauld/
我正在尝试编写我的第一个GUI。但是,教程的代码通过创建一个窗口来启动:

import Tkinter

top = Tkinter.Tk()
dir(顶部)

不起作用。 Python解释器并没有抱怨什么,
但是教程承诺的窗口将不会出现。我在Ubuntu 5.10上使用了Python 2.4.2和Eric 3.7.0 IDE。有人知道要做什么吗?
Hi, I''m using the "Learning to Program" GUI tutorial on
http://www.freenetpages.co.uk/hp/alan.gauld/
and am trying to write my first GUI. However, the code the tutorial
gives for starting by making a window:
import Tkinter

top = Tkinter.Tk()

dir(top)

Does not work. The Python interpreter does not complain about anything,
but the window the tutorial promises will apperar will not. I''m using
Python 2.4.2 and the Eric 3.7.0 IDE on Ubuntu 5.10. Anybody know what
to do?




你必须调用top.mainloop()才能正常工作。什么是dir(),顺便问一下?用于创建应用程序的是

类吗?



You have to call top.mainloop() for it work. What is dir(), btw? Is it a
class for creating the application?


John Salerno写道:
John Salerno wrote:
什么是dir(),顺便问一下?它是用于创建应用程序的类吗?
What is dir(), btw? Is it a
class for creating the application?




嘿嘿,我多快忘记内置插件。 :)尝试这样的事情:


导入Tkinter为tk


root = tk.Tk()

label = tk.Label(root,text =''Hello world!'')

label.pack()

root.mainloop()



Heh heh, how quickly I forget about built-ins. :) Try something like this:

import Tkinter as tk

root = tk.Tk()
label = tk.Label(root, text=''Hello world!'')
label.pack()
root.mainloop()


6月5日,John Salerno< jo ****** @ nospamgmail.com>写道:
On 6/5/06, John Salerno <jo******@nospamgmail.com> wrote:
什么是dir(),顺便说一下?它是一个用于创建应用程序的类吗?
What is dir(), btw? Is it a class for creating the application?



[Bernard]在你的Python文档中,dir()在

内置函数中描述( 2.1)以及教程,在

" Modules"部分(第6章)。除非你是讽刺的? ;-)

Bernard


[Bernard] In your Python documentation, dir() is described in the
built-in functions (section 2.1) as well as the tutorial, in the
"Modules" section (chapter 6). Unless you were being sarcastic? ;-)
Bernard


这篇关于GUI程序错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆