About Python Tkinter and creating .a GUI

jdatta247 54 views 13 slides Aug 22, 2024
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI toolkit,[1] and is Python's de facto standard GUI.[2] Tkinter is included with standard Linux, Microsoft Windows and macOS installs of Python.

The name Tkinter comes from Tk interface. Tkinter w...


Slide Content

PYTHON – TKINTER BY M.SUMANA SREE MSC COMPUTER SCIENCE 1 ST YEAR ARK DEGREE & PG COLLEGE

USER INTERFACE User interface allow the user to interact with electronic devices. Generally we have two types of user interfaces which are CLI – (Command Line Interface) Command line interface is operated by using commands and used in Linux Operating system GUI – (Graphical User Interface) Graphical user interface is operated by using graphical icons and visual indicators commonly used in Windows OS

Python Libraries For GUI Python provides various options for developing graphical user interfaces (GUIs). Most important are listed below Tkinter wxPython Jpython and other etc

Here are the some other Python GUI Libraries as shown in the above figure Kivy PythonQt

Tkinter ? Tkinter is the standard (default) GUI library for Python. Python when combined with Tkinter provides a fast and easy way to create GUI applications. Tkinter provides a powerful object-oriented interface to the Tk GUI toolkit. It is based on the Tk toolkit, originally designed for the (TCL) Tool Command Language. Due to Tk’s popularity, it has been ported to a variety of other scripting languages, including Perl (Perl/Tk), Ruby (Ruby/Tk) and Python ( Tkinter ).

It is a platform independent can use in (Unix/Windows/Mac) Operating systems. Popular open-source scripting language/GUI widget set developed by John Ousterhout in 90s FEATURES : Easy to use Cross-platform Highly customizable

KEY FEATURES Widgets: Tkinter provides various controls used in GUI application. These controls are commonly called Widgets (buttons, labels etc ). Layouts: Layout Management - Organizing widgets with ease using the pack(), grid() and place(). Events: Handling Events – Using command callbacks or bind events to respond to user interactions with event-driven programming. Tkinter provides various options and styles for customization.

Creating a GUI application is using Tkinter is an easy task. All you need to do is to perform the following steps- Import Tkinter module Create the GUI application main window Add one or more widgets to the GUI application Enter the main event loop to take action against each event triggered by the user. Creating GUI application using Tkinter

Simple way to remember!

Example : #!/usr/bin/python import tkinter top = tkinter.Tk () #Code to add widgets will go here.. top.mainloop () This would create a following window 

REAL-WORLD APPLICATIONS

CONCLUSION : “ Tkinter is a powerful and easy-to-use GUI library for Python ”

THANK YOU