Python Forum
How to create a simple GUI
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create a simple GUI
#1
Hello,
I am starting a new school project where I need to control a aolenoid and actuator with a RPI. Normally it would no problem, just write a little script and done. This time however, I need to create a user interface that is always running and the user can come and control the solenoid and actuator in a simple manner.

I know,I have google but I dont even know where to start looking, so I thought maybe a little guidance could help.
Reply
#2
There are many options, but Tkinter would probably be a good place to start for a simple GUI. See documentation here.
Reply
#3
Where does the GUI run?
Reply
#4
Also, after you answer deanhystad's question:

An FYI:

you can always search for packages here: https://pypi.org/
Reply
#5
(Mar-25-2021, 03:32 PM)deanhystad Wrote: Where does the GUI run?

It would run in a Raspberry pi zero that is connected to windows via ssh.
Reply
#6
For various reasons, Python has left GUIs open, not particularly choosing one over another, and therefore a number of them have popped up and you can pick what you like.

If you are choosing to use a browser display, Flask is most popular, with Django and FastAPI good alternatives for more complex programs (though some pretty complex apps have been written using Flask).

Apps running on a graphical desktop such as Windows, Mac, or the myriad of Linux interfaces would use other APIs. Tkinter has been mentioned and is popular. I like Wx.
Reply
#7
Hi there GRS26! Cool
I know how to make a simple Gui so I wanted to help you!
Normally I use tkinter, it's an easy library in Python.
To import the library type this code in your first line of code: from tkinter import *
Now to make the GUI you just need to type this code:
whateveryouwanttocalltheguiwindow = Tk()
If you are going to use the GUI window then just use that variable.
For example if you would like to configure the size of the window to 500x500 you would type in a new line:
guiwindowname.geometry("500x500")
I hope I was able to help you! If you need some more help or if you need more understanding please contact me! have a wonderful day :)
Reply
#8
(Mar-25-2021, 02:23 PM)GRS26 Wrote: I know,I have google but I dont even know where to start looking, so I thought maybe a little guidance could help.
I suffered for weeks trying to find out a simple GUI that could solve the kind of problems you have. To begin with, there are too many solutions available. For a newbie it is hard to find the best one. Besides that, the learning curve may be quite steep.

To me, most recommended package was tkinter. It is old, stable, well documented. But is also complex.
I finally came across PySimpleGUI (with variants, like PySimpleGUIQt). For me it was the answer. In less than 10 minutes I learned enough to make the GUI I needed at the time.

You could start by checking this page: https://pysimplegui.readthedocs.io/
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  which is the best library to create a simple web browser? vivekagrey 3 2,383 Jan-11-2020, 05:24 AM
Last Post: vivekagrey
  Simple Button click on image file to create action? jpezz 4 6,796 Mar-27-2019, 10:08 PM
Last Post: jpezz
  I'm trying to create a simple yes/no dialog box RedSkeleton007 15 18,410 Apr-25-2018, 05:10 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020