May 31, 2021 06:02 AM
(This post was last modified: May 31, 2021 06:03 AM by Doc.)
Just wondering if creating desktop GUIs for Python programs is typically worth the hassle, because I've been working with Tkinter using it to create a GUI for this YouTube video downloader application I'm making, and man, it's gotten to the point where I feel like next time I'd rather go ahead and set it up to run solely from the command line, or just go jump off a cliff instead.
But I don't know, maybe if I had more experience with using Tkinter (or one of the other Python GUI options) it wouldn't be such a headache, although I'm still not entirely sure that'd be the case...
What do you all think? Does using Tkinter or the other GUI tools for Python ever become something that's not a complete pain in the ass to do? Or is there a reason Python programs with GUIs aren't very common?
Here's a screenshot of my program, currently still a WIP:
One thing that's REALLY felt like a ridiculous time waster has been having to constantly re-run my code to test out different x,y coordinates for where I want certain labels and buttons to be placed. Is there something or a way to make that shit easier? Because if so, I would love to know.
There are GUI builder for Python, though not efficient. In case you know any other programming language, e.g. C++ or JS (going with the Electron framework), preferably use those.
As mentioned, Python isn't practical for GUI application.
May 31, 2021 07:30 AM
(This post was last modified: May 31, 2021 07:31 AM by h0lyl337.)
I use to do the same thing, now i just use qt designer or html if i decide to make a gui. Coding a gui from scratch is a waist of time, unless you are getting paid for it, or you need some complex gui's.
May 31, 2021 11:13 AM
(This post was last modified: May 31, 2021 06:28 PM by newQuery.)
You could use Flask or Django, but it'd become a web app. However, you will be in total control of your design
“Whatever Your Mind Can Conceive and Believe, It Can Achieve.” – Napoleon Hill
I've used RedEdit to design GUI layouts for years. Easiest and flattest way of doing so I've come across to this day. It's (sometimes) considered "outdated", but it gets the job done. Visual Studio has a GUI editor which works in a similar fashion (as well as, I think, NetBeans) but RedEdit gives the immediate, necessary information I need to set up GUIs in C/C++. That being sizes and coords. I've no experience with any other method of designing GUI layouts.
http://www.resedit.net/
Aside from that, command line isn't that hard if you don't need to do the research to set up the automation script. Coding said scripts is a pain in the ass if you do end up needing to do so. Here's a short example of my own Batch script I use to individually download videos. Definitely not porn videos, anyway:
PHP Code
<?php @cd %~dp0 :start @set /p "input=Enter input stream: " youtube-dl.exe --newline -o "%%(title)s.%%(ext)s" --ignore-config --hls-prefer-native "%input%" goto start
Run that script, paste the link, and go, go, go.
Yeah, also, if you're definitely not downloading porn videos from select sites which use HLS streaming, ytdl requires the playlist file link. Use something like this: https://addons.mozilla.org/en-US/firefox...-detector/
Thanks for all the feedback and tips guys, I decided to go ahead and re-do the application in Visual Studio as a WPF using XAML for the GUI layout. I've gotta re-learn C# and get used to creating GUI's and how events work within VS again but I've been needing to that anyway.
(May 31, 2021 10:03 PM)Sajuuk Wrote: I've used RedEdit to design GUI layouts for years. Easiest and flattest way of doing so I've come across to this day. It's (sometimes) considered "outdated", but it gets the job done. Visual Studio has a GUI editor which works in a similar fashion (as well as, I think, NetBeans) but RedEdit gives the immediate, necessary information I need to set up GUIs in C/C++. That being sizes and coords. I've no experience with any other method of designing GUI layouts.
http://www.resedit.net/
Aside from that, command line isn't that hard if you don't need to do the research to set up the automation script. Coding said scripts is a pain in the ass if you do end up needing to do so. Here's a short example of my own Batch script I use to individually download videos. Definitely not porn videos, anyway:
PHP Code
<?php @cd %~dp0 :start @set /p "input=Enter input stream: " youtube-dl.exe --newline -o "%%(title)s.%%(ext)s" --ignore-config --hls-prefer-native "%input%" goto start
Run that script, paste the link, and go, go, go.
Yeah, also, if you're definitely not downloading porn videos from select sites which use HLS streaming, ytdl requires the playlist file link. Use something like this: https://addons.mozilla.org/en-US/firefox...-detector/
Thanks for the RedEdit tip, I'm gonna check it out and see how I like it when I get a chance. Appreciate the other advice as well!
Jun 2, 2021 07:06 AM
(This post was last modified: Jun 2, 2021 07:11 AM by synchronizing.)
(May 31, 2021 06:02 AM)Doc Wrote: ...
But I don't know, maybe if I had more experience with using Tkinter (or one of the other Python GUI options) it wouldn't be such a headache, although I'm still not entirely sure that'd be the case...
...
I recommend using Qt and PyQt5. Installing Qt Open Source is a breeze and allows you to install and use Qt Designer, which is a full "drag-and-drop" GUI tool dev environment. In Qt Designer you can export the final view as a .ui, and convert it to Python (.py) via the pyuic5 CLI.
Documentation takes a little to get use to because PyQt5 is build on top of the existing C++ Qt5 code, but after a few hours of development (and assuming one understands C++), you are rolling. Using PyInstaller you can package the whole application, and then have yourself a decently lightweight .exe or .dmg. The drag-and-drop editor alone sold me. I would recommend checking it out.
|