Using Tkinter To Create A GUI (Graphical User Interface) On The Raspberry Pi
Using Tkinter To Create A GUI (Graphical User Interface) On The Raspberry Pi
Windows applications have been doing this for many years. Tkinter
application.
https://medium.com/@ronm333/using-tkinter-to-create-a-gui-graphical-user-interface-on-the-raspberry-pi-b382a6bf6497 1/9
5/26/2017 Using Tkinter to Create a GUI (Graphical User Interface) on the Raspberry Pi
When a user clicks on the Turn LED On button, the LED is turned on
Python 3.54 was used to create the Using tkinter window. The
3.54. To see what versions of Python and tkinter you have: click on the
https://medium.com/@ronm333/using-tkinter-to-create-a-gui-graphical-user-interface-on-the-raspberry-pi-b382a6bf6497 2/9
5/26/2017 Using Tkinter to Create a GUI (Graphical User Interface) on the Raspberry Pi
I have typed in: import tkinter, and on the next line, tkinter._test()
the 8.6 version, tkinter is imported and not Tkinter, and some
https://pymotw.com/3/porting_notes.html
Our simple example application also includes the use of gpiozero 1.3.1.
https://www.raspberrypi.org/downloads/raspbian/
https://medium.com/@ronm333/using-tkinter-to-create-a-gui-graphical-user-interface-on-the-raspberry-pi-b382a6bf6497 3/9
5/26/2017 Using Tkinter to Create a GUI (Graphical User Interface) on the Raspberry Pi
Below we show the LED circuit and the source code of our program,
tkButtons.py
The LEDCircuit
Parts needed for the circuit include an LED, 330 Ohm resistor, and
The positive leg of the LED (the longer one with a bend at the top) is
https://medium.com/@ronm333/using-tkinter-to-create-a-gui-graphical-user-interface-on-the-raspberry-pi-b382a6bf6497 4/9
5/26/2017 Using Tkinter to Create a GUI (Graphical User Interface) on the Raspberry Pi
tkButtons.py
The source code of tkButtons.py is shown below. It shows how to use
tkinter 8.6 with python 3.4.2. For a good introduction to using tkinter,
https://www.packtpub.com/mapt/book/Application%20Development
/9781785889738
https://medium.com/@ronm333/using-tkinter-to-create-a-gui-graphical-user-interface-on-the-raspberry-pi-b382a6bf6497 5/9
5/26/2017 Using Tkinter to Create a GUI (Graphical User Interface) on the Raspberry Pi
Line 8 connects the positive leg of the LED on the breadboard to pin
when a user clicks on the Turn LED On / Turn LED O button. If the
LED On. If the LED is o, it is turned on, and the buttons label is
The tkinter ledButton object and the tkinter exitButton object are
https://medium.com/@ronm333/using-tkinter-to-create-a-gui-graphical-user-interface-on-the-raspberry-pi-b382a6bf6497 6/9
5/26/2017 Using Tkinter to Create a GUI (Graphical User Interface) on the Raspberry Pi
References
More information about tkinter modules are given at:
http://www.tutorialspoint.com/python/python_gui_programming.ht
Tutorial: Create your own GUI (Graphical User Interface) with TkInter
and Python
https://www.youtube.com/watch?v=Bvq0LdBn0dY
https://medium.com/@ronm333/using-tkinter-to-create-a-gui-graphical-user-interface-on-the-raspberry-pi-b382a6bf6497 7/9
5/26/2017 Using Tkinter to Create a GUI (Graphical User Interface) on the Raspberry Pi
https://medium.com/@ronm333/using-tkinter-to-create-a-gui-graphical-user-interface-on-the-raspberry-pi-b382a6bf6497 8/9
5/26/2017 Using Tkinter to Create a GUI (Graphical User Interface) on the Raspberry Pi
https://medium.com/@ronm333/using-tkinter-to-create-a-gui-graphical-user-interface-on-the-raspberry-pi-b382a6bf6497 9/9