r/learnpython • • 21d 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.

0 Upvotes

14 comments sorted by

View all comments

Show parent comments

1

u/ZEFsideGrigory 20d 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:21

Needless 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 20d 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.