mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	svn+ssh://pythondev@svn.python.org/python/trunk ........ r78779 | benjamin.peterson | 2010-03-07 20:11:06 -0600 (Sun, 07 Mar 2010) | 1 line remove svn:executable from scripts without a shebang line ........
		
			
				
	
	
		
			17 lines
		
	
	
	
		
			331 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			331 B
		
	
	
	
		
			Python
		
	
	
	
	
	
# Display hello, world in a button; clicking it quits the program
 | 
						|
 | 
						|
import sys
 | 
						|
from tkinter import *
 | 
						|
 | 
						|
def main():
 | 
						|
    root = Tk()
 | 
						|
    button = Button(root)
 | 
						|
    button['text'] = 'Hello, world'
 | 
						|
    button['command'] = quit_callback       # See below
 | 
						|
    button.pack()
 | 
						|
    root.mainloop()
 | 
						|
 | 
						|
def quit_callback():
 | 
						|
    sys.exit(0)
 | 
						|
 | 
						|
main()
 |