24
loading...
This website collects cookies to deliver better user experience
Note- Tkinter provides a powerful object-oriented interface to the Tk-GUI toolkit. GUI requires a lot of OOP stuff. OOP python is still not covered in this course, and would be subsequently covered after GUI is completed. So till that time, don't worry if OOP things are not 100% clear. While learning GUI it is important to understand how to design things rather than how they are implemented by python. Learning OOP concepts will throw light upon how they are implemented and things will start getting clearer and clearer.
The Tkinter package is actually an interface to the GUI toolkit, called as Tk-GUI. However, Tkinter is not the only GUI Programming toolkit for Python. It is one of the most common and easy to learn interface. It is the only framework that’s built into the Python standard library. Other notable interfaces are wxPython and JPython (Jython. wxPython is an open-source Python interface for wxWindows, while JPython is a Python port for Java. JPython boasts of giving Python scripts a seamless access to Java class libraries on the local machine. Other alternatives include- PyQt, PySide, Pygame, Pyglet, and PyGTK. You can check them out at the wiki links provided.
Didn't work for you? Well it didn't work for me either.
C:\Users\aatma>python -m tkinter
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
py
keyword opens python, so typing in py -m tkinter
worked for me.Common mistake-- We need to type this in the command prompt, and not the python command line!
C:\Users\aatma>py
Python 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> python -m tkinter
File "<stdin>", line 1
python -m tkinter
^
SyntaxError: invalid syntax