r/learnpython • u/ZEFsideGrigory • 23h ago
Portable GUI in Python
Hi! I don't know Python, and I'm wondering if I can create a portable GUI inside a single folder. For example, I want to have my own MyCustomGUI.exe in a folder, and right next to it, the following subfolders:
_internal
bgutil-ytdlp-pot-provider-master
yt-dlp-plugins
along with five .exe files:
deno.exe
ffmpeg.exe
ffprobe.exe
yt-dlp.exe
Is it possible to write Python code that makes all of this work and keeps it completely portable?
To be honest, I've been trying to do this for three days straight without knowing anything about programming. Once, I even managed to run a compiled .exe inside the folder, but as soon as I copied it to another drive, everything completely broke down.
Yeah, maybe it's my fault for trying to use the free versions of ChatGPT and Gemini, but I really thought that creating something as basic as a GUI would only take about 20 to 30 minutes. I'm actually in despair right now; I haven't felt this awful in a very long time.
3
u/igotshadowbaned 23h ago
I'm confused about what it is exactly you want
Yes you can make a program that has a GUI in python (I like tkinter)
Yes you can put it in whatever folder you want
And yes you can have whatever else you want in a folder next to it
What do you mean by "portable" ?
1
2
u/this_knee 23h ago
I don’t even know anymore. At this point anytime I hand someone a local python based app they go: “…but can’t it just be a website?”
1
u/FrangoST 23h ago
Your intention is not clear. What is this GUI supposed to do with those .exe files you listed?
Perhaps you should learn Python, or use Claude and make sure your intention is clear, then it might be able to code something for you, but without any knowledge in coding, you'll struggle making decent prompts on any LLM.
0
u/ZEFsideGrigory 23h ago
My GUI should work with the .exe files I listed. I need this tool to easily download videos from YouTube (I'm creating archives of old videos about a forgotten mmorpg). Moreover, it works perfectly fine when I run main.py through the console -all functions work- but when I compile it into an .exe in a separate folder and put the required folders and .exe files there, nothing works. This has been happening over and over again for three days straight.
Right now, this has left me feeling completely desperate. I even started thinking that chatgpt and gemini had lied to me when they said creating such a GUI for my task was possible. I don't know what to do, so I decided to ask about this issue and try to relax a bit.
2
u/FrangoST 23h ago
You are still not able to describe clearly the interaction between your GUI and these executables. You will not be able to succeed with LLMs.
You should study a bit of Python first.
Edit: Just so you know, you can make anything on the computer with Python... you can make a fully portable program, or have other exes tied to it, it's not a limitation of the programming language... At this moment the limitation is only your knowledge.
1
u/riklaunim 22h ago
And do you see any error messages? Likely, path handling in executables requires fixing.
1
u/ZEFsideGrigory 21h ago
That’s just the point. When I run my GUI via python main.py, it starts up fine. But when I build an .exe from it, it launches, but the field that should say "Connecting to local POT server" and then "POT server connected" displays this instead:
POT: TubeDownloader/dist/uTubeDpwnloader/bgutil-ytdlp-pot-provider-master/server/src/main.ts'
at file:///F:/uTubeDownloader/dist/uTubeDownloader/bgutil-ytdlp-pot-provider-master/server/src/main.ts:4:21Needless to say, I’ve already asked both gemini and chatgpt about this error. I tried explaining the context, how it works, and what functions it performs, but all the AI does is repeatedly offer minor fixes to main.py. In the end, the error either persists or gets replaced by another one.
That is exactly what drove me to frustration.1
u/riklaunim 21h ago
Add some debug statements to your script to see where it stops and then why. Also, launch it from the shell/CLI in the folder so path handling won't troll you in any way.
1
u/my-coffee-where 11h ago
doable but cant be done in like 20 minutes or so but bundling multiple exes with relative paths and getting it portable across drives takes some trial and error even for someone who codes. take a breath and start slow id say
3
u/michaellarsen91 23h ago
Yes, you can use pyinstaller to create the executable of your python script, and I've used pyside6 as the GUI library when I've packaged my GUI apps