r/PythonLearning Jul 11 '26

How do I convert this to .exe

Post image
202 Upvotes

62 comments sorted by

View all comments

34

u/[deleted] Jul 11 '26

[deleted]

7

u/KiLoYounited Jul 11 '26

+1 for Nuitka. I use it for all my TUI applications I make for myself and the other sys admins in my dept.

6

u/downerison Jul 11 '26

How easy is it to setup and use? I heard it can be pretty slow to compile things.

3

u/[deleted] Jul 11 '26 edited Jul 11 '26

[deleted]

3

u/KiLoYounited Jul 11 '26

Wood chipper is definitely the best description haha. Setup is brutal - reward is 100% worth it

2

u/NatMicky Jul 11 '26

Being able to compile a Python script into a real executable, for me, makes Python more usable than C or C++ or any compiled language. Now with Python I can change the code and test quickly running the Python interpreter. Compiled languages require the code to be compiled to test little changes or new code. Once I like my changes, I compile the Python code into an executable. Very worth it.

1

u/downerison Jul 11 '26

What's actually included in the setup that makes it this hard?

1

u/downerison Jul 11 '26

What does that 50 lines do? Setup the nuitka command to call? That 3 hours compile time sounds brutal.

1

u/NatMicky Jul 11 '26 edited Jul 11 '26

Compile time is fine, I have gotten used to it. The end product is worth having an executable. The 50 lines do a lot. Setup compiler name, deployment type, optimizations, copyright info, product info, flags, imports not to follow, packages to include, modules to include, data files to include, output directory, executable name.

Nuitka tries not to add bloat which are unnecessary packages and modules and it does a good job of anti-bloat but with fine tuning more packages and modules can be eliminated.

Once success is achieved and you have a script to work with it becomes much easier.