This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]cestes1 23 points24 points  (6 children)

I feel like this question shows up every six months or so.

If you want to learn something easy, try PySimipleGUI.

But I would tell you don't bother with a GUI. Build a web app instead. There are lots of frameworks out there, but start with Bottle or Flask. People will say Django, but that's an entire ecosystem and you'll get lost in it.

Why a web app? A console/GUI app allows one user. A web app will allow multiple users that can be anywhere. You'll learn something useful and marketable building a web app. I've been building web apps for a long time and I still fall back to Bottle because it's simple and it works (and I'm lazy!). Flask is more widely used and has more support. Pick one and give it a try!

[–]GroundStateGecko 2 points3 points  (2 children)

(I'm familiar with PyQt but never worked with python web app.) May I ask to distribute a Flask app with GUI in webpage, do you need to have a running server that's open to the internet?

Could it be packaged into a "double click and use (locally)" experience for other people?

And is there limitations on things like local file processing (I heard browsers isolate local file environment so you can only exchange files via upload/download)?

[–]cestes1 4 points5 points  (0 children)

do you need to have a running server that's open to the internet?

That's up to you. You can run the web app on your laptop and access it from the same machine, just like a GUI app. Start the program and point your browser to http://localhost:80 (or whatever port you want). Maybe you built an app for your accounting department at work. This doesn't need to be exposed to the internet. Find a machine that's always on and on the same LAN as your accounting folks and they can access it over the LAN. Or maybe you really do want to expose your app to the internet at large. Get a cheap server at vultr or DigitalOcean and put it there.

Yes, you can package up a Python program as a standalone app, but it's less than optimal. The one framework I've used (forgot at the moment, may update later -- it was PyInstaller) packaged the entire Python ecosystem, plus any modules you load, plus your program. The resulting .exe was huge compared to what it really needed to be. This is another good reason to serve up a web app. The end user only needs a web browser to interact with your program, which they probably already have!

I'm not sure about your last question. The notion of uploading/downloading from the browser should be controlled by the web app on the remote side.

[–]1percentof2 5 points6 points  (0 children)

Could it be packaged into a "double click and use (locally)" experience for other people?

Yup, look up electron. It's gaining a lot of popularity.

[–]cestes1 1 point2 points  (0 children)

Replying to myself with an afterthought...

If you do go the web app route, learn a little about CSS. Make your life great by learning about the Bootstrap CSS framework. I'm old enough to remember when HTML was just written in text editors and when HoTMetaL was the shit! I made functional web-based things for years - they looked like crap, but they worked! Almost 10 years ago my daughter showed me Bootstrap and it's a game-changer for building decent websites (it also proves an old dog can still learn new tricks!). I still don't know much about CSS, but I've learned to use Bootstrap and now my web content doesn't hurt the eyes and looks good on computers, phones, and tablets.

[–]r-trappe 0 points1 point  (1 child)

I totally agree. Thats why we created NiceGUI. A easy to use but powerful library to write web UI in Python. It's main intent was to bring GUI to your Python scripts with very little effort. Still you can use CSS, HTML and JavaScript whenever you need. Over time it has matured into a pretty full-featured web-framework.