User Guide

61
c) Create the GUI module needed on the object and enable the functions.
d) Connect the GUI modules with the code at the system back-end.
e) Enter the main event loop.
Take a simple GUI program:
Create a file Tk_test.py under the path /home:
touch Tk_test.py
Add executable privilege to the file:
chmod +x Tk_test.py
Open the file:
vim Tk_test.py
Type in the following code:
#!/usr/bin/env python
from Tkinter import *
top = Tk() # Create a top window
top.title('Sunfounder.com')
label = Label(top, text='Hello Geeks !', fg='blue') # Create a label and set
its foreground color as blue
label.pack() # layout
top.mainloop() # main loop
Save the code and exit.
Run
./Tk_test.py
Then the following picture will appear on your screen:
Click to close the program.
SunFounder