Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Building Python GUIs for the Web
#1
Question 
Hello everyone,

i am currently starting off a project in which I should kind of combine several already existing GUIs so a User can comfortably switch between them.
These GUIs are implemented using different technology (e.g. one is done with GTK, one is already webbased with Vue.js). I thought probably making everything webbased would be the most flexible solution.
The team that developed the GUI with GTK usually codes in Python 2 so they said it would be cool, if they would be able to easily switch to the technology that I will choose.

So I wanted to find out about Python in Web Developement and GUI development, which with both I have no prior experience with. I have only used Python with ROS and done some Web Development with e.g. React.
I read about Flask, Django, electron.js which seems to offer some kind of possibility to use it with python as well as e.g. kivy to make more traditional GUIs outside the web etc.

Is there a possibility to start or embed already exiting "offline" python GUIs into a webpage?
Or is there a technology that is currently recommendable for Building Web-GUIs with Python, similar to how you build them "offline"?

I don't really know where to start as I am still a beginner and would be glad about any tips!
Thank you in advance.
Reply
#2
You probably shouldn't think of embedding those GUIs in a web page, but rather about whether the codebase is well factored enough that you can replace the display quite easily. If separation of concerns is lacking (in this case, perhaps that means components responsible for displaying things are also responsible for "business logic"), then that needs addressing.
Reply
#3
@ndc85430
Thank you already!
I will find out more about the separation of logic and display.
If it is the case, that the display can be replaced quite easily, what could be the next steps for me to choose a technology and start doing my first steps?
Also if you are talking about the it could be quite easy to make a new webbased display, can I directly generate UIs with Python just like I would do normally with Javascript?
I have to get in touch with the other developers more which is kind of difficult at the moment.
If it is possible to generate webbase GUI like it is possible with javascript, would you recommend doing so?
I am not sure because one GUI already is made using javascript. Should I be using javascript to display the actual GUI and kind of make it work with the python code or should I be using Python?
Reply
#4
There are plenty of webframeworks in Python - Django, Flask, Bottle, web2py, to name a few
I would suggest you have a look at some tutorial to get an idea. Then choose a frameowork and dive deeper.

For start you may look at our Tutorials:
https://python-forum.io/Forum-Web-Tutorials

(Apr-01-2020, 07:15 AM)SpaceTime Wrote: Should I be using javascript to display the actual GUI and kind of make it work with the python code or should I be using Python?
You can integrate javascript in the front-end/display side
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
Thank you too, buran! :)
Then I will definitely take a look into those.

(Apr-01-2020, 07:25 AM)buran Wrote: You can integrate javascript in the front-end/display side
I am not quite sure, what this means exactly?
Also is it possible to have a web application where some GUIs are made with javascript and some with python or will this just become a big mess in the end (and I should just choose one and hope the other UIs can be changed accordingly without a big hassle)?
Reply
#6
Did you look at our tutorial section as advised? I think you will find these answers there
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  building python payment gateway or bank account for secure money transfer masoud_da 0 1,762 Feb-28-2019, 12:12 PM
Last Post: masoud_da

Forum Jump:

User Panel Messages

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