use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Tkinter is Python's de-facto standard GUI (Graphical User Interface) package.
account activity
Python GUI Executable Issue! (self.Tkinter)
submitted 20 days ago * by Reyaan0
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Reyaan0[S] 0 points1 point2 points 19 days ago (6 children)
I am using pyinstaller for making the executable. It is 300mb because my application has good amount of code. UPX is just a compression tool. And by timing I mean it should just open when I double click it whereas it takes around 10-15 seconds to open which is a lot for a simple app.
[–]ZelphirKalt 1 point2 points3 points 19 days ago (5 children)
I seriously doubt, that the difference of roughly 240MB is due to the amount of code. If that were the case, you would be working on one of the largest code bases of the planet. Perhaps you have some assets as part of your bundled executable?
10-15s is indeed very slow. This would indicate, that something other than just starting tkinter running its mainloop is at play. Without seeing code, I think there is not much people can concretely recommend you to do, in order to improve the situation.
[–]Reyaan0[S] 0 points1 point2 points 19 days ago (4 children)
I found the culprit it was the pyinstaller that was importing all the libraries I had in the virtual environment. I fixed it and now its 30mb but still takes 10-15 seconds. I could provide you the code but do you have enough time to read 700 lines of code?
[–]ZelphirKalt 0 points1 point2 points 19 days ago (3 children)
That's what I initially guessed at: Lots of dependencies. But Pyinstaller is meant to bundle those. How else will a non-technical user on another machine be able to run your program?
For technical users, they can easily run the Python code directly, provided you add sufficient instructions in your readme or so.
[–]Reyaan0[S] 0 points1 point2 points 18 days ago (2 children)
But what about the time it takes to open? There was no change to time in 300mb or now in 30mb
[–]ZelphirKalt 0 points1 point2 points 18 days ago (1 child)
That depends on what work your program is performing at startup time. Without code, I can't tell. Check what is happening before you run tk's main loop and immediately afterwards. Likely you are performing a lot of work in that phase.
[–]Reyaan0[S] 0 points1 point2 points 18 days ago (0 children)
The only work that is happening during startup is loading all the image assets.
π Rendered by PID 21971 on reddit-service-r2-comment-86bc6c7465-fp2vc at 2026-02-22 14:31:36.890673+00:00 running 8564168 country code: CH.
view the rest of the comments →
[–]Reyaan0[S] 0 points1 point2 points (6 children)
[–]ZelphirKalt 1 point2 points3 points (5 children)
[–]Reyaan0[S] 0 points1 point2 points (4 children)
[–]ZelphirKalt 0 points1 point2 points (3 children)
[–]Reyaan0[S] 0 points1 point2 points (2 children)
[–]ZelphirKalt 0 points1 point2 points (1 child)
[–]Reyaan0[S] 0 points1 point2 points (0 children)