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
Содержание Smart Video Car Kit B+
Страница 5: ...2 Components A Acrylic Plates S u n F o u n d e r ...
Страница 9: ...6 USB Wi Fi adapter 1 USB camera 1 18650 2 Battery holder 1 Ribbon 1 USB cable 1 S u n F o u n d e r ...
Страница 30: ...27 The whole picture of wiring should be like this S u n F o u n d e r ...
Страница 57: ...54 S u n F o u n d e r ...
Страница 65: ...62 Process Diagram of Client Program S u n F o u n d e r ...