Gui programming with
Python by default is a text base programming language, for this reason if we wanna have graphical user interface with it, we need to use extra framework "module".
There are many choices for Gui programming in python, for example:
WxPython, PyGui, Pyside, Tkinter, Pyqt and ...
Tkinter have some pros and cons:
pros: Its part of the standard library so you dont need to download any extra module, have large community, and its simple, and some programmers use it even for writing some basic games . and its cross platform you can use it on windows, linux and mac and it worth to mention that written by Fredrik Lundh, so thanks Fredrik.
Cons: its ugly :D, thats what some people say a bout it but its a mater of personal taste. it doesnt have pythonic look! and of course its not naturally part of the python, its just a wrapper around the TK and Tci module which is interpreted embedded in python interpreter. Tkinter can be used by other languages as well.
in Tkinter we are dealing with Widgets and events, same as Pygame, Turtle . because every program that have constant interaction with user is Event Driven Program.
as i mentioned before Tkinter is part of python standard library, so the only thing we need to do is to import it.
In first example we are going to create a main window. same as what we do when working with Pygame or turtle to create the screen.
so we create a main window and call the main loop to keep it up and running.