Lesson 10

THis is python lesson 10

In this lesson we will be moving on to adding graphics to our programs. So far everything has just been text and we will now add a GUI. A GUI is a Graphical User Interface. We will be using a library called tkinter.

import tkinter

window = tkinter.TK()

window.title(“PythonStar”)

window.geometry(“300×300”)

window.mainloop()

The above piece of code is the code for GUI which is just a box at the moment. First we import tkinter, then we have to say window =tkinter.tk(). Then we choose the title in the next line. Then how big the box is. Then we finish with window.mainloop(). This should make a box with the title PythonStar. We will continue tkinter next lesson.