SlideShare 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.
It’s 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 infinite 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 Configuration
Tkinter offers access to the geometric configuration 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 specific
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 defined 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

Python exception handling
Python   exception handlingPython   exception handling
Python exception handling
Mohammed Sikander
 
Python basic
Python basicPython basic
Python basic
Saifuddin Kaijar
 
Java swing
Java swingJava swing
Java swing
Apurbo Datta
 
Python Presentation
Python PresentationPython Presentation
Python Presentation
Narendra Sisodiya
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
Mohammed Sikander
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
Devashish Kumar
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
Tareq Hasan
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
WebStackAcademy
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
narmadhakin
 
Python Flow Control
Python Flow ControlPython Flow Control
Python Flow Control
Mohammed Sikander
 
List in Python
List in PythonList in Python
List in Python
Siddique Ibrahim
 
tkinter final ppt.ppt
tkinter final ppt.ppttkinter final ppt.ppt
tkinter final ppt.ppt
KanuAgrawal2
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in java
Google
 
Python Basics
Python BasicsPython Basics
Python Basics
tusharpanda88
 
Java awt (abstract window toolkit)
Java awt (abstract window toolkit)Java awt (abstract window toolkit)
Java awt (abstract window toolkit)
Elizabeth alexander
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in python
baabtra.com - No. 1 supplier of quality freshers
 
Variables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaVariables & Data Types In Python | Edureka
Variables & Data Types In Python | Edureka
Edureka!
 
python Function
python Function python Function
python Function
Ronak Rathi
 
Python 3 Programming Language
Python 3 Programming LanguagePython 3 Programming Language
Python 3 Programming Language
Tahani Al-Manie
 

What's hot (20)

Python exception handling
Python   exception handlingPython   exception handling
Python exception handling
 
Python basic
Python basicPython basic
Python basic
 
Java swing
Java swingJava swing
Java swing
 
Python Presentation
Python PresentationPython Presentation
Python Presentation
 
Python Functions
Python   FunctionsPython   Functions
Python Functions
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
 
Java: GUI
Java: GUIJava: GUI
Java: GUI
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Conditional and control statement
Conditional and control statementConditional and control statement
Conditional and control statement
 
Python Flow Control
Python Flow ControlPython Flow Control
Python Flow Control
 
List in Python
List in PythonList in Python
List in Python
 
tkinter final ppt.ppt
tkinter final ppt.ppttkinter final ppt.ppt
tkinter final ppt.ppt
 
Event Handling in java
Event Handling in javaEvent Handling in java
Event Handling in java
 
Python Basics
Python BasicsPython Basics
Python Basics
 
Threads in python
Threads in pythonThreads in python
Threads in python
 
Java awt (abstract window toolkit)
Java awt (abstract window toolkit)Java awt (abstract window toolkit)
Java awt (abstract window toolkit)
 
Object oriented programming in python
Object oriented programming in pythonObject oriented programming in python
Object oriented programming in python
 
Variables & Data Types In Python | Edureka
Variables & Data Types In Python | EdurekaVariables & Data Types In Python | Edureka
Variables & Data Types In Python | Edureka
 
python Function
python Function python Function
python Function
 
Python 3 Programming Language
Python 3 Programming LanguagePython 3 Programming Language
Python 3 Programming Language
 

Similar to Python GUI

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
 
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
 
The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212
Mahmoud Samir Fayed
 
Developing on Windows 8
Developing on Windows 8Developing on Windows 8
Developing on Windows 8
Einar Ingebrigtsen
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
Umar Yusuf
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
Umar Yusuf
 
Python Libraries and Modules
Python Libraries and ModulesPython Libraries and Modules
Python Libraries and Modules
RaginiJain21
 

Similar to Python GUI (20)

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
 
Chapter - 6.pptx
Chapter - 6.pptxChapter - 6.pptx
Chapter - 6.pptx
 
GUI Programming using Tkinter-converted.pptx
GUI Programming using Tkinter-converted.pptxGUI Programming using Tkinter-converted.pptx
GUI Programming using Tkinter-converted.pptx
 
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...
 
Kids Games
Kids GamesKids Games
Kids Games
 
PyQt.pptx
PyQt.pptxPyQt.pptx
PyQt.pptx
 
Python GUI Programming Tkinter and.pdf
Python GUI Programming Tkinter and.pdfPython GUI Programming Tkinter and.pdf
Python GUI Programming Tkinter and.pdf
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
 
python PPT Session 1.pptx
python PPT Session 1.pptxpython PPT Session 1.pptx
python PPT Session 1.pptx
 
Introduction to GUIs with guizero
Introduction to GUIs with guizeroIntroduction to GUIs with guizero
Introduction to GUIs with guizero
 
Simple calulator using GUI tkinter.pptx
Simple calulator using GUI tkinter.pptxSimple calulator using GUI tkinter.pptx
Simple calulator using GUI tkinter.pptx
 
Vista uipi.ppt (1)
Vista uipi.ppt (1)Vista uipi.ppt (1)
Vista uipi.ppt (1)
 
lec 9.pptx
lec 9.pptxlec 9.pptx
lec 9.pptx
 
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
 
G T K+ 101
G T K+ 101G T K+ 101
G T K+ 101
 
The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212The Ring programming language version 1.10 book - Part 83 of 212
The Ring programming language version 1.10 book - Part 83 of 212
 
Developing on Windows 8
Developing on Windows 8Developing on Windows 8
Developing on Windows 8
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
 
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!DESKTOP GUI APP DEVELOPMENT USING PYTHON!
DESKTOP GUI APP DEVELOPMENT USING PYTHON!
 
Python Libraries and Modules
Python Libraries and ModulesPython Libraries and Modules
Python Libraries and Modules
 

Recently uploaded

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
Fwdays
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
CatarinaPereira64715
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 

Recently uploaded (20)

UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 

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. It’s 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 infinite 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 Configuration Tkinter offers access to the geometric configuration 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 specific 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 defined 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