hello.py

来自「基于网络编程的例子」· Python 代码 · 共 28 行

PY
28
字号
#!/usr/bin/env python# this is a translation of "Hello World III" from the GTK manual,# using gtk.pyfrom gtk import *def hello(*args):    print "Hello World"    window.destroy()def destroy(*args):    window.hide()    mainquit()window = GtkWindow(WINDOW_TOPLEVEL)window.connect("destroy", destroy)window.set_border_width(10)button = GtkButton("Hello World")button.connect("clicked", hello)window.add(button)button.show()window.show()mainloop()

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?