In this article, we will learn how to create a standard converter using tkinter. Now we are going to create an introduction window that displays loading bar, welcome text, and user’s social media profile links so that when he/she shares his code with some others, they can contact the author using those resources. It looks like a bit lengthy code, but believe me, guys if you start understanding it is so easy and i divided the code into blocks which helps you to understand better.
Steps to create an introduction window:
- First of all, “Tkinter” and “webbrowser” modules to be imported.
- Create an intro class that fires the introduction window.
- Create a Toplevel Tkinter window in order to use full features of a window.
- Place a welcome label on the top of the window.
- Create one “ttk.Progressbar” which gives us loading effect.
- Finally, create four buttons and provide your social media links using “webbrowser” module.
- And you have to download/create four images to represent your social media links.
Below is the Intro class implementation :
Steps to create a Converter window:
- Create a separate class for the converter window.
- We will split the window into two halves horizontally with suitable color combination.
- And now we need to create two Tkinter entry boxes, two Tkinter labels, two buttons to activate a list box, one hamburger icon for the menu.
- Place the above things at their respective positions using .place method of a Tkinter widget.
- Now we need to feed the formulae of each unit, to convert into other units, in separate dictionaries.
- Feed the input values in the main function and pass them while initializing or using the setter method of a class
- We need to create shift function using which the user will be able to shift from one parameter to another parameter.
Below is the Converter class implementation :
Now create a main function and create a set of dictionaries to feed unit formulae values and call the “intro()” class to fire the converter. Here you can see your contact links, loading bar etc. You will also need to create a “center” function if you want your window to be fired at the center of the screen.
Below is the Full code implementation :
- You need to install “tkinter” and “webbrowser” libraries.
- Creating a introduction window is your choice(It’s not mandatory). But I suggest you to create that one also.
- You need to create toplevel windows because we can’t destroy a main window as it may corrupt all our project.
- You don’t need to install various IDE’s, it works perfectly fine on python IDLE.
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.
- Temperature Converter using Tkinter
- Python | Simple GUI calculator using Tkinter
- Python | Distance-time GUI calculator using Tkinter
- Python - Compound Interest GUI Calculator using Tkinter
- Python | Create a GUI Marksheet using Tkinter
- Python: Weight Conversion GUI using Tkinter
- Python | ToDo GUI Application using Tkinter
- Python | GUI Calendar using Tkinter
- Sentiment Detector GUI using Tkinter - Python
- Python - Morse Code Translator GUI using Tkinter
- Create First GUI Application using Python-Tkinter
- Python - SpongeBob Mocking Text Generator GUI using Tkinter
- Python - Spell Corrector GUI using Tkinter
- Python - UwU text convertor GUI using Tkinter
- GST Rate Finder GUI using Python-Tkinter
- Create Copy-Move GUI using Tkinter in Python
- Python - English (Latin) to Hindi (Devanagiri) text convertor GUI using Tkinter
- GUI chat application using Tkinter in Python
- Text to speech GUI convertor using Tkinter in Python
- Python - Dynamic GUI Calculator using Tkinter module
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.