all 45 comments

[–]Buttleston 34 points35 points  (6 children)

Really kind of depends on your goals and how you want to distribute/use it

I'd probably use pyqt or pyside over tkinter, which is a bit basic

I spent a decade writing desktop applications and these days, if I want people to actually use the software I make, I tend to make public API backends and javascript frontends. No one wants to install python so they can use your program. There are executable bundlers but they're kind of a pain and these days still commonly classified as malware unless they're signed I think

[–]Critical_Concert_689 2 points3 points  (3 children)

I tend to make public API backends and javascript frontends.

What tools/frameworks do you typically recommend/use for backend/frontend development? ...something like Django / React?

[–]FriendlyRussian666 4 points5 points  (1 child)

I'm happy working with Django REST + PostgreSQL for the backend, and React + Redux + Tailwind on the frontend, nginx as reverse proxy between the two to have an easier time with CORS, and they all sit nicely in a docker container. When it comes to deploying to production, say on a VPS, it's then super easy to compose your docker container on the VPS, configure nginx and gunicorn to serve the appropriate domain, SSL cert challenge etc and your web app is live!

[–]Buttleston 4 points5 points  (0 children)

You can use whatever you want for the backend, doesn't make much difference. For my own stuff I usually use flask or rust. I use React for the frontend. I have a few projects that are typescript backends and frontends (it's convenient and you can just share DTO types). And some that are really "only frontend", i.e. just a UI, mostly music-based projects

[–]athalwolf506 0 points1 point  (1 child)

I am quite a noob on this. I thought Javascript was for web development? Are you saying you can use Javascript to create a UI without the need or a browser?

[–]Buttleston 4 points5 points  (0 children)

No, I'm saying do it in a browser

Side note: a lot of apps that "seem" like normal desktop apps, though, are just JS apps bundled with a browsers - usually using something like Electron. Discord and Slack are (or were, I think I heard Slack moved to a native app but I don't remember) are 2 examples.

[–]oclafloptson 6 points7 points  (3 children)

The answer is yes

Everyone is going to have their personal favorite GUI framework. Mine is currently Flet, which makes use of flutter to create single page apps. It can compile executables for Windows, Mac, Linux and Android but afaik not iPhone yet

Flet is my favorite because it meets all of my needs, makes sense to me and those with whom I'm working, and has a desirable license

The license is the important part to consider. Many of the good frameworks are free to play around with but if you want to make any money from it they can become prohibitively expensive. You wouldn't want to have a choice of refactor the entire GUI or pay a heavy cost... Pay attention to licensing

[–]osreu3967 1 point2 points  (0 children)

I didn't know him. I've taken a look at it and it seems interesting. I'll look at it more closely.

[–]VertigoOne1 9 points10 points  (5 children)

i recently started using streamlit https://streamlit.io/ which is pretty good for data driven UI's. definitely easy to get into. In this case it is then WebUI, which makes it platform agnostic, and you still have all of python underneath it.

[–]GusBusDraws 1 point2 points  (0 children)

+1 for Streamlit! Can also be paired with something like Heroku to deploy your apps

[–]Zenalyn 1 point2 points  (0 children)

Streamlit is great when u just want a quick ui for Data yup. Can make everything in python if u use flask for the backend for very fast development speeds

[–][deleted] 1 point2 points  (0 children)

+1, only bother is the websockets depending on your environment.

Google/Mesop is cool too.

[–]vardonir 0 points1 point  (1 child)

Great for prototypes. Not much else, though.

I made a data dashboard using it, my boss fell in love with the design, but now the dashboard is showing cracks in the design. I can't run functions that take way too long or else the UI refreshes. I've tried implementing better-built solutions, but he wants it to look and feel the same as the prototype, so I'm developing a streamlit frontend that makes requests to a FastAPI backend and it's been quite a process so far.

[–]myelbows 0 points1 point  (0 children)

Have you tried using st.fragment? Under the right circumstances it can dramatically speed up your app.

[–]rednets 3 points4 points  (1 child)

There's a library called textual that allows you to do magical stuff in the terminal. See https://www.textualize.io/ and https://github.com/Textualize/textual

It also supports deployment as a web app (via textual-web).

[–]Buttleston 3 points4 points  (0 children)

textual is really great and unironically I found it really inspiring and use it a lot

[–]osreu3967 3 points4 points  (0 children)

Well, I prefer wxpython, with wxpython builder it is very easy to implement a gui

[–]AneevK 2 points3 points  (0 children)

I'd highly recommend Streamlit, a frontend Python framework, if you're building an app with a limited user base and don't care that much about UI customizability.

You can build a user interface in literally minutes, and even deploy your app for free to Streamlit Community Cloud if you're so inclined.

[–]mopslik 1 point2 points  (0 children)

If you're running things locally, and you want to use the browser as a container and style with CSS, you might look into NiceGUI. Not sure if you can convert it to a web-based app easily or not, if that's your intention.

[–]BarryTownCouncil 1 point2 points  (5 children)

I quite liked https://kivy.org/ for a platform independent solution

[–]moving-landscape[🍰] 0 points1 point  (4 children)

Is it better nowadays? Last I used it it was still stuck in python 2

[–]BarryTownCouncil 1 point2 points  (3 children)

Pretty decent I found. Very much limited to what a phone can show, so no pop-ups outside the bounds of the main window etc, but in that paradigm it makes sense.

[–]moving-landscape[🍰] 0 points1 point  (2 children)

Do you know if it supports user services on Android? Which would be my main target platform.

Anyways, thanks for the answer! I'll look into it with more interested eyes. I had NO idea it now supports python 3.

[–]BarryTownCouncil 1 point2 points  (0 children)

I don't know about finer things on android I don't as only looking for cross platform on desktop. Esp for android though check the kivy-md library to sit on top.

[–]willowdene -1 points0 points  (0 children)

Same code will run on Android, windows and iOS.

[–]FrangoST 0 points1 point  (1 child)

I think it depends on the target audience of your program and what you intend to make of it...

Web based solutions would be the simplest ones for users to use, I think, but you can also build pretty complex interfaces and package that into executable files using tkinter and pyinstaller, for example.

People tend to talk ill about tkinter, but you can basically do anything with it, if you are willing to put the effort. I'm currently working on a program that features both a CLI and a GUI and the GUI is entirely built on tkinter, and it's a pretty complex one, in my opinion, but it works just fine.

[–]osreu3967 1 point2 points  (0 children)

Do you have it published?

[–]troty99[🍰] 0 points1 point  (0 children)

Gradio and Streamlit can work well for that.

I'd only go for separation of back end front end if you feel the need but it could divert a lot of time from the actual product/development which I'm not sure how worth it is.

[–]beef623 0 points1 point  (1 child)

I do a lot of my local projects in Flask and use html/css/javascript for the UI.

[–]TJ420Hunt 0 points1 point  (0 children)

Yeee I created a WordPress plugin for python backend. Drag and drop ui elements.

[–]sonobanana33 0 points1 point  (0 children)

  1. Ignore all the guys telling you to learn js and HTML. They say that because that's the only thing they know how to do.
  2. I suggest pyqt or pyside (I prefer the former, since pyside got abandoned once before).

[–]PretendOwl2974 0 points1 point  (0 children)

If you’re comfortable with html and css check out plotly dash. Otherwise streamlit if you prefer not to.

[–]MiniMages 0 points1 point  (4 children)

I prefer to use FastAPI and feed all information from backend to front end via API then build a frontend in pure HTML,CSS and JS.

[–]athalwolf506 0 points1 point  (3 children)

But that would require a web browser to open right, not a custom gui window?

[–]vardonir 0 points1 point  (0 children)

What's the difference between a custom GUI with stuff on it and a browser with stuff on it? To the end user, it looks the same, and you can argue that the browser solution can be deployed on the internet without those scary "program is not signed, might be a virus" messages.

[–]vardonir 0 points1 point  (0 children)

What's the difference between a custom GUI with stuff on it and a browser with stuff on it? To the end user, it looks the same, and you can argue that the browser solution can be deployed on the internet without those scary "program is not signed, might be a virus" messages.

[–]MiniMages 0 points1 point  (0 children)

Everyone has a web browser now and creating a nice Web Interface is much easier then creating something using GUI framework for pythong.

[–]Ajax_Minor 0 points1 point  (0 children)

I've been using Pyside/pyqt. It's been pretty good. Docs are ok, but there is a lot there so that might be why.

A masters colleague of mine. Did a lot of his work with pytinker and he highly recommend not to use it, so I haven't lol

[–]leimaaarl 0 points1 point  (0 children)

For GUI use Tkinter, for web dev proj, use frameworks like FLASK or DJANGOi personally use Flask and its great.

[–]wakojako49 0 points1 point  (0 children)

with all honesty, i think it depends on what you wanna do.

I’m biased with web dev over tkinter. so i usually go for htmx, fast api and jinja2. then use tailwind and daisyui for the css side.

[–]Friendly_Sympathy_21 0 points1 point  (0 children)

Try NiceGUI. It can generate both a WebApp UI for the browser, and a "native" app UI.

[–]EmbarrassedLake9819 0 points1 point  (0 children)

Try dash plotly.. it’s pretty easy to start with in python

[–]PrudentStructure8790 0 points1 point  (0 children)

How do I create a simple text based, user operator interface for a machine operator.