Python Desktop GUI – Part 1

As modern technology is upgrading every day there are lots of options to choose while developing Desktop Application. Python and Tkinter are among them.
Python Desktop GUI
403 Views

Hi there! today I just wanted to discuss the python desktop ui. Actually, I have been researching the topic for the last few months then I just got a simple method to do so.

Python is a programming language with many features and libraries that can be used to create desktop GUI applications. One such library is Tkinter, which is a standard GUI library for Python. In this article, we will see how to create a Python desktop GUI application using Tkinter.

We will first see how to create a simple popup window using Tkinter. Then, we will see how to add various widgets to the window. Finally, we will see how to connect the application to a database.

Creating a Python desktop GUI application can be a fun and rewarding experience. With Tkinter, you can easily create a Python desktop GUI application that looks great and is also easy to use.

Python is a very strong programing language and can be used for various other purposes of example: Extracting Images from a Video.

Please be with this blog till the end. Please follow the steps for python desktop ui:

  1. Create a directory and then install python v3, pip, pipenvTkinter, pyinstaller, tkmessagebox.
  2. Create a file i.e. desktop_main.py
# Create python file inside your project folder
C:\Users\COM\Desktop\pydesktop> touch desktop_main.py

Inside the dektop_main.py

from tkinter import *
def populate_list():
    print('Populate')
def add_item():
    print('Add')
# dektop window create
app = Tk()
name_text = StringVar()
name_label = Label(app, text='Full Name : ', font=('bold', 14), pady=20)
name_label.grid(row=0, column=0, sticky=W)
name_entry = Entry(app, textvariable=name_text)
name_entry.grid(row=0,column=1)


#name list box
name_list = Listbox(app, height=8, width=50)
name_list.grid(row=3, column=0, columnspan=3, rowspan=6, pady=20, padx=20)
#scrillbar
scrollbar = Scrollbar(app)
scrollbar.grid(row=3, column=3)
name_list.configure(yscrollcommand=scrollbar.set)
scrollbar.configure(command=name_list.yview)


#button
add_button = Button(app, text='Add Name', width=12, command=add_item)
add_button.grid(row=2, column=0, pady=20)
#window title
app.title('Main Window')
#window dimensions
app.geometry('850x450')
populate_list()
#start app
app.mainloop()

Will explain the above peace of code in the next blog.

Python Script
Python Script Screen Shot

Now its time to run your first desktop GUI app

# Execute your desktop_main.py
C:\Users\COM\Desktop\pydesktop>python dektop_main.py
Desktop UI uing Python
Desktop UI using Python

Is that simple? just a few steps and you are good to go.

OK, thanks.. will explain in detail in the next article about Tkinter and DB [store, retrieve, delete] integration on the same app.

You can see some other sites for similar topics.

Total
0
Shares
Previous Post
Data Encryption Using PHP Web Development

Data Encryption Using PHP openssl_pkey

Next Post
Secure Your Data with AES sha256 bit Encryption and Decryption method using PHP

PHP AES 256-bit Encryption and Decryption

Related Posts