際際滷

際際滷Share a Scribd company logo
Python GUI
Luscious Larry Das
About Python GUI
Python is an interactive programming which has multiple options
for developing GUI (Graphical User Interface). Some of them are
1. Kivy - Linux, Windows, OS X, Android, IOS, Raspberry Pi
2. PyQT - Linux, Windows, OS X, Android, IOS
3. PyForms - Linux, Windows, OS X
4. WxPython - Linux, Windows, OS X
5. Tkinter - Linux, Windows, OS X
About Tkinter
Tkinter is the standard 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.
Its built in library so no need to install. Just need to import.
How it work?
1. Tk() - To create a main window, tkinter offers a method Tk()
2. mainloop() - is an in鍖nite loop used to run the application, wait
for an event to occur and process the event as long as the
window is not closed.
Widget
Tkinter provides various controls, such as buttons, labels and text
boxes used in a GUI application. There are currently 15 types of
widgets in Tkinter.
1. Button 6. Label 11. Radiobutton
2. Canvas 7. Listbox 12. Scrollbar
3. Checkbutton 8. Menubutton 13. Text
4. Entry 9. Menu 14. Toplevel
5. Frame 10. Message 15. PhotoImage
Geometry Con鍖guration
Tkinter offers access to the geometric con鍖guration of the widgets
which can organize the widgets in the parent windows. There are
mainly three geometry manager classes class.
1. pack() - organizes the widgets in blocks
2. grid() - organizes the widgets in grid (table-like structure)
3. place() - organizes the widgets by placing them on speci鍖c
positions
How to add widgets?
Button(window, option=value) - Options (activebackground,
activeforeground, bg, command, font, image, height, width)
Image Widget
Tkinter user PhotoImage() to display images. But with this widget
we only can display GIF images.
To display other format images we need to install pillow package.
Example code on pillow
Events and Binds
Tkinter provides a mechanism to let the programmer deal with
events. For each widget, it's possible to bind Python functions and
methods to an event.
widget.bind(event, handler)
If the de鍖ned event occurs in the widget, the "handler" function is
called with an event object. describing the event.
Events List
1. <Button>: <Button-1>(left), <Button-2>(middle), <Button-3>(right), <Button-4>(scroll
up), <Button-5>(scroll down)
2. <Double-Button>: <Double-Button-1>(left), <Double-Button-2>(middle),
<Double-Button-3>(right)
3. <Enter>
4. <Leave>
5. <Return>
6. <Key>
Connection with DB
Git links
1. Learning Python - https://github.com/larrydanny/learning-python
2. Some APPs - https://github.com/larrydanny/python-apps
3. Simple Calculator - https://github.com/larrydanny/very-simple-calculator-python
4. Some Games - https://github.com/larrydanny/python-games
Thank You

More Related Content

What's hot (20)

Python GUI Programming
Python GUI ProgrammingPython GUI Programming
Python GUI Programming
RTS Tech
Python Modules
Python ModulesPython Modules
Python Modules
Nitin Reddy Katkam
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
Damian T. Gordon
Introduction to matplotlib
Introduction to matplotlibIntroduction to matplotlib
Introduction to matplotlib
Piyush rai
Python programming : Classes objects
Python programming : Classes objectsPython programming : Classes objects
Python programming : Classes objects
Emertxe Information Technologies Pvt Ltd
Introduction to-python
Introduction to-pythonIntroduction to-python
Introduction to-python
Aakashdata
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
Devashish Kumar
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
TMARAGATHAM
Regular expressions in Python
Regular expressions in PythonRegular expressions in Python
Regular expressions in Python
Sujith Kumar
Python Functions
Python   FunctionsPython   Functions
Python Functions
Mohammed Sikander
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
NumPy
NumPyNumPy
NumPy
AbhijeetAnand88
Python ppt
Python pptPython ppt
Python ppt
Mohita Pandey
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
Sujith Kumar
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
eShikshak
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
Chariza Pladin
Modules in Python Programming
Modules in Python ProgrammingModules in Python Programming
Modules in Python Programming
sambitmandal
Python : Data Types
Python : Data TypesPython : Data Types
Python : Data Types
Emertxe Information Technologies Pvt Ltd
Python functions
Python functionsPython functions
Python functions
Prof. Dr. K. Adisesha
Python GUI Programming
Python GUI ProgrammingPython GUI Programming
Python GUI Programming
RTS Tech
Python: Modules and Packages
Python: Modules and PackagesPython: Modules and Packages
Python: Modules and Packages
Damian T. Gordon
Introduction to matplotlib
Introduction to matplotlibIntroduction to matplotlib
Introduction to matplotlib
Piyush rai
Introduction to-python
Introduction to-pythonIntroduction to-python
Introduction to-python
Aakashdata
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
Devashish Kumar
Modules and packages in python
Modules and packages in pythonModules and packages in python
Modules and packages in python
TMARAGATHAM
Regular expressions in Python
Regular expressions in PythonRegular expressions in Python
Regular expressions in Python
Sujith Kumar
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
Megha V
Basics of Object Oriented Programming in Python
Basics of Object Oriented Programming in PythonBasics of Object Oriented Programming in Python
Basics of Object Oriented Programming in Python
Sujith Kumar
Introduction to python for Beginners
Introduction to python for Beginners Introduction to python for Beginners
Introduction to python for Beginners
Sujith Kumar
Datatypes in python
Datatypes in pythonDatatypes in python
Datatypes in python
eShikshak
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
Chariza Pladin
Modules in Python Programming
Modules in Python ProgrammingModules in Python Programming
Modules in Python Programming
sambitmandal

Similar to Python GUI (20)

A Complete seminar on GUI Development in python
A Complete seminar on GUI Development in pythonA Complete seminar on GUI Development in python
A Complete seminar on GUI Development in python
18547Mymoon
Python Training on python and SQL PPT.pptx
Python Training on python and SQL PPT.pptxPython Training on python and SQL PPT.pptx
Python Training on python and SQL PPT.pptx
xelihom699
Chapter - 6.pptx
Chapter - 6.pptxChapter - 6.pptx
Chapter - 6.pptx
MikialeTesfamariam
GUI Programming using Tkinter-converted.pptx
GUI Programming using Tkinter-converted.pptxGUI Programming using Tkinter-converted.pptx
GUI Programming using Tkinter-converted.pptx
dvarshitha04
Python is a high-level, general-purpose programming language. Its design phil...
Python is a high-level, general-purpose programming language. Its design phil...Python is a high-level, general-purpose programming language. Its design phil...
Python is a high-level, general-purpose programming language. Its design phil...
bhargavi804095
graphical user interface using python easy
graphical user interface using python easygraphical user interface using python easy
graphical user interface using python easy
ravipati23phd7217
Kids Games
Kids GamesKids Games
Kids Games
Jatinder Kumar Chaurasia
About Python Tkinter and creating .a GUI
About Python Tkinter and creating .a GUIAbout Python Tkinter and creating .a GUI
About Python Tkinter and creating .a GUI
jdatta247
Graphical Programming in Python Using Tkinter
Graphical Programming in Python Using TkinterGraphical Programming in Python Using Tkinter
Graphical Programming in Python Using Tkinter
IndianInstituteofCom
d1c70870-58fb-4da8-ae54-28d1c44a7347.pptx
d1c70870-58fb-4da8-ae54-28d1c44a7347.pptxd1c70870-58fb-4da8-ae54-28d1c44a7347.pptx
d1c70870-58fb-4da8-ae54-28d1c44a7347.pptx
pritigaikwad801
PyQt.pptx
PyQt.pptxPyQt.pptx
PyQt.pptx
manishgupta316325
Python GUI Programming Tkinter and.pdf
Python GUI Programming Tkinter and.pdfPython GUI Programming Tkinter and.pdf
Python GUI Programming Tkinter and.pdf
AmirKhan811717
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
William Lee
python PPT Session 1.pptx
python PPT Session 1.pptxpython PPT Session 1.pptx
python PPT Session 1.pptx
RobertHook14
Introduction to GUIs with guizero
Introduction to GUIs with guizeroIntroduction to GUIs with guizero
Introduction to GUIs with guizero
primeteacher32
Simple calulator using GUI tkinter.pptx
Simple calulator using GUI tkinter.pptxSimple calulator using GUI tkinter.pptx
Simple calulator using GUI tkinter.pptx
YashSharma357857
Vista uipi.ppt (1)
Vista uipi.ppt (1)Vista uipi.ppt (1)
Vista uipi.ppt (1)
Edgar Barbosa
lec 9.pptx
lec 9.pptxlec 9.pptx
lec 9.pptx
MaheshSharan
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Prabindh Sundareson
G T K+ 101
G T K+ 101G T K+ 101
G T K+ 101
Ahmed Saeed
A Complete seminar on GUI Development in python
A Complete seminar on GUI Development in pythonA Complete seminar on GUI Development in python
A Complete seminar on GUI Development in python
18547Mymoon
Python Training on python and SQL PPT.pptx
Python Training on python and SQL PPT.pptxPython Training on python and SQL PPT.pptx
Python Training on python and SQL PPT.pptx
xelihom699
GUI Programming using Tkinter-converted.pptx
GUI Programming using Tkinter-converted.pptxGUI Programming using Tkinter-converted.pptx
GUI Programming using Tkinter-converted.pptx
dvarshitha04
Python is a high-level, general-purpose programming language. Its design phil...
Python is a high-level, general-purpose programming language. Its design phil...Python is a high-level, general-purpose programming language. Its design phil...
Python is a high-level, general-purpose programming language. Its design phil...
bhargavi804095
graphical user interface using python easy
graphical user interface using python easygraphical user interface using python easy
graphical user interface using python easy
ravipati23phd7217
About Python Tkinter and creating .a GUI
About Python Tkinter and creating .a GUIAbout Python Tkinter and creating .a GUI
About Python Tkinter and creating .a GUI
jdatta247
Graphical Programming in Python Using Tkinter
Graphical Programming in Python Using TkinterGraphical Programming in Python Using Tkinter
Graphical Programming in Python Using Tkinter
IndianInstituteofCom
d1c70870-58fb-4da8-ae54-28d1c44a7347.pptx
d1c70870-58fb-4da8-ae54-28d1c44a7347.pptxd1c70870-58fb-4da8-ae54-28d1c44a7347.pptx
d1c70870-58fb-4da8-ae54-28d1c44a7347.pptx
pritigaikwad801
Python GUI Programming Tkinter and.pdf
Python GUI Programming Tkinter and.pdfPython GUI Programming Tkinter and.pdf
Python GUI Programming Tkinter and.pdf
AmirKhan811717
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
William Lee
python PPT Session 1.pptx
python PPT Session 1.pptxpython PPT Session 1.pptx
python PPT Session 1.pptx
RobertHook14
Introduction to GUIs with guizero
Introduction to GUIs with guizeroIntroduction to GUIs with guizero
Introduction to GUIs with guizero
primeteacher32
Simple calulator using GUI tkinter.pptx
Simple calulator using GUI tkinter.pptxSimple calulator using GUI tkinter.pptx
Simple calulator using GUI tkinter.pptx
YashSharma357857
Vista uipi.ppt (1)
Vista uipi.ppt (1)Vista uipi.ppt (1)
Vista uipi.ppt (1)
Edgar Barbosa
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with XgxperfDeveloping and Benchmarking Qt applications on Hawkboard with Xgxperf
Developing and Benchmarking Qt applications on Hawkboard with Xgxperf
Prabindh Sundareson

Recently uploaded (20)

Transactional Outbox & Inbox Patterns.pptx
Transactional Outbox & Inbox Patterns.pptxTransactional Outbox & Inbox Patterns.pptx
Transactional Outbox & Inbox Patterns.pptx
Maysam Mousa
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
DianaGray10
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly MeetupLeadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
GDG Kathmandu
STRING FUNCTIONS IN JAVA BY N SARATH KUMAR
STRING FUNCTIONS IN JAVA BY N SARATH KUMARSTRING FUNCTIONS IN JAVA BY N SARATH KUMAR
STRING FUNCTIONS IN JAVA BY N SARATH KUMAR
Sarathkumar Narsupalli
Build Your Uber Clone App with Advanced Features
Build Your Uber Clone App with Advanced FeaturesBuild Your Uber Clone App with Advanced Features
Build Your Uber Clone App with Advanced Features
V3cube
Automated Engineering of Domain-Specific Metamorphic Testing Environments
Automated Engineering of Domain-Specific Metamorphic Testing EnvironmentsAutomated Engineering of Domain-Specific Metamorphic Testing Environments
Automated Engineering of Domain-Specific Metamorphic Testing Environments
Pablo G坦mez Abajo
Microsoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdfMicrosoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdf
Abhishek Agarwal
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic RelationshipTrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship
TrustArc
Network_Packet_Brokers_Presentation.pptx
Network_Packet_Brokers_Presentation.pptxNetwork_Packet_Brokers_Presentation.pptx
Network_Packet_Brokers_Presentation.pptx
Khushi Communications
AI in Talent Acquisition: Boosting Hiring
AI in Talent Acquisition: Boosting HiringAI in Talent Acquisition: Boosting Hiring
AI in Talent Acquisition: Boosting Hiring
Beyond Chiefs
Benefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle CloudBenefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle Cloud
AstuteBusiness
Building High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdfBuilding High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdf
Rafael Burity
Innovative Web Design | Malachite Technologies
Innovative Web Design | Malachite TechnologiesInnovative Web Design | Malachite Technologies
Innovative Web Design | Malachite Technologies
malachitetechnologie1
EXCEPTION HANDLING IN JAVA BY N SARATH KUMAR
EXCEPTION HANDLING IN JAVA BY N SARATH KUMAREXCEPTION HANDLING IN JAVA BY N SARATH KUMAR
EXCEPTION HANDLING IN JAVA BY N SARATH KUMAR
Sarathkumar Narsupalli
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
Ivan Tang
Threat Modeling a Batch Job System - AWS Security Community Day
Threat Modeling a Batch Job System - AWS Security Community DayThreat Modeling a Batch Job System - AWS Security Community Day
Threat Modeling a Batch Job System - AWS Security Community Day
Teri Radichel
Top Tips to Get Your Data AI-Ready
Top Tips to Get Your Data AI-Ready   Top Tips to Get Your Data AI-Ready
Top Tips to Get Your Data AI-Ready
Precisely
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
jackalen173
San Francisco Atlassian ACE - Mar 27 2025.pdf
San Francisco Atlassian ACE - Mar 27 2025.pdfSan Francisco Atlassian ACE - Mar 27 2025.pdf
San Francisco Atlassian ACE - Mar 27 2025.pdf
Matt Doar
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and FeastSmarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Zilliz
Transactional Outbox & Inbox Patterns.pptx
Transactional Outbox & Inbox Patterns.pptxTransactional Outbox & Inbox Patterns.pptx
Transactional Outbox & Inbox Patterns.pptx
Maysam Mousa
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
SAP Automation with UiPath: Solution Accelerators and Best Practices - Part 6...
DianaGray10
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly MeetupLeadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
Leadership Spectrum by Sonam Sherpa at GDG Kathmandu March Monthly Meetup
GDG Kathmandu
STRING FUNCTIONS IN JAVA BY N SARATH KUMAR
STRING FUNCTIONS IN JAVA BY N SARATH KUMARSTRING FUNCTIONS IN JAVA BY N SARATH KUMAR
STRING FUNCTIONS IN JAVA BY N SARATH KUMAR
Sarathkumar Narsupalli
Build Your Uber Clone App with Advanced Features
Build Your Uber Clone App with Advanced FeaturesBuild Your Uber Clone App with Advanced Features
Build Your Uber Clone App with Advanced Features
V3cube
Automated Engineering of Domain-Specific Metamorphic Testing Environments
Automated Engineering of Domain-Specific Metamorphic Testing EnvironmentsAutomated Engineering of Domain-Specific Metamorphic Testing Environments
Automated Engineering of Domain-Specific Metamorphic Testing Environments
Pablo G坦mez Abajo
Microsoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdfMicrosoft Digital Defense Report 2024 .pdf
Microsoft Digital Defense Report 2024 .pdf
Abhishek Agarwal
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic RelationshipTrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship
TrustArc Webinar - Data Privacy and Cyber Security: A Symbiotic Relationship
TrustArc
Network_Packet_Brokers_Presentation.pptx
Network_Packet_Brokers_Presentation.pptxNetwork_Packet_Brokers_Presentation.pptx
Network_Packet_Brokers_Presentation.pptx
Khushi Communications
AI in Talent Acquisition: Boosting Hiring
AI in Talent Acquisition: Boosting HiringAI in Talent Acquisition: Boosting Hiring
AI in Talent Acquisition: Boosting Hiring
Beyond Chiefs
Benefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle CloudBenefits of Moving Ellucian Banner to Oracle Cloud
Benefits of Moving Ellucian Banner to Oracle Cloud
AstuteBusiness
Building High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdfBuilding High-Impact Teams Beyond the Product Triad.pdf
Building High-Impact Teams Beyond the Product Triad.pdf
Rafael Burity
Innovative Web Design | Malachite Technologies
Innovative Web Design | Malachite TechnologiesInnovative Web Design | Malachite Technologies
Innovative Web Design | Malachite Technologies
malachitetechnologie1
EXCEPTION HANDLING IN JAVA BY N SARATH KUMAR
EXCEPTION HANDLING IN JAVA BY N SARATH KUMAREXCEPTION HANDLING IN JAVA BY N SARATH KUMAR
EXCEPTION HANDLING IN JAVA BY N SARATH KUMAR
Sarathkumar Narsupalli
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
2025-04-05 - Block71 Event - The Landscape of GenAI and Ecosystem.pdf
Ivan Tang
Threat Modeling a Batch Job System - AWS Security Community Day
Threat Modeling a Batch Job System - AWS Security Community DayThreat Modeling a Batch Job System - AWS Security Community Day
Threat Modeling a Batch Job System - AWS Security Community Day
Teri Radichel
Top Tips to Get Your Data AI-Ready
Top Tips to Get Your Data AI-Ready   Top Tips to Get Your Data AI-Ready
Top Tips to Get Your Data AI-Ready
Precisely
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
Fast Screen Recorder v2.1.0.11 Crack Updated [April-2025]
jackalen173
San Francisco Atlassian ACE - Mar 27 2025.pdf
San Francisco Atlassian ACE - Mar 27 2025.pdfSan Francisco Atlassian ACE - Mar 27 2025.pdf
San Francisco Atlassian ACE - Mar 27 2025.pdf
Matt Doar
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and FeastSmarter RAG Pipelines: Scaling Search with Milvus and Feast
Smarter RAG Pipelines: Scaling Search with Milvus and Feast
Zilliz

Python GUI

  • 2. About Python GUI Python is an interactive programming which has multiple options for developing GUI (Graphical User Interface). Some of them are 1. Kivy - Linux, Windows, OS X, Android, IOS, Raspberry Pi 2. PyQT - Linux, Windows, OS X, Android, IOS 3. PyForms - Linux, Windows, OS X 4. WxPython - Linux, Windows, OS X 5. Tkinter - Linux, Windows, OS X
  • 3. About Tkinter Tkinter is the standard 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. Its built in library so no need to install. Just need to import.
  • 4. How it work? 1. Tk() - To create a main window, tkinter offers a method Tk() 2. mainloop() - is an in鍖nite loop used to run the application, wait for an event to occur and process the event as long as the window is not closed.
  • 5. Widget Tkinter provides various controls, such as buttons, labels and text boxes used in a GUI application. There are currently 15 types of widgets in Tkinter. 1. Button 6. Label 11. Radiobutton 2. Canvas 7. Listbox 12. Scrollbar 3. Checkbutton 8. Menubutton 13. Text 4. Entry 9. Menu 14. Toplevel 5. Frame 10. Message 15. PhotoImage
  • 6. Geometry Con鍖guration Tkinter offers access to the geometric con鍖guration of the widgets which can organize the widgets in the parent windows. There are mainly three geometry manager classes class. 1. pack() - organizes the widgets in blocks 2. grid() - organizes the widgets in grid (table-like structure) 3. place() - organizes the widgets by placing them on speci鍖c positions
  • 7. How to add widgets? Button(window, option=value) - Options (activebackground, activeforeground, bg, command, font, image, height, width)
  • 8. Image Widget Tkinter user PhotoImage() to display images. But with this widget we only can display GIF images. To display other format images we need to install pillow package. Example code on pillow
  • 9. Events and Binds Tkinter provides a mechanism to let the programmer deal with events. For each widget, it's possible to bind Python functions and methods to an event. widget.bind(event, handler) If the de鍖ned event occurs in the widget, the "handler" function is called with an event object. describing the event.
  • 10. Events List 1. <Button>: <Button-1>(left), <Button-2>(middle), <Button-3>(right), <Button-4>(scroll up), <Button-5>(scroll down) 2. <Double-Button>: <Double-Button-1>(left), <Double-Button-2>(middle), <Double-Button-3>(right) 3. <Enter> 4. <Leave> 5. <Return> 6. <Key>
  • 12. Git links 1. Learning Python - https://github.com/larrydanny/learning-python 2. Some APPs - https://github.com/larrydanny/python-apps 3. Simple Calculator - https://github.com/larrydanny/very-simple-calculator-python 4. Some Games - https://github.com/larrydanny/python-games