Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

How to Convert Python Source code to exe effectively !??

i tried all public tools once again [ auto py to ee - py2exe...Etc ] Python 3.9 🤣

any clear or solid solutions yet?? my program include tkinter GUI wich never run after compiling 🤦‍♂️

Thanks again
what kind of error are you getting? you are probably not including something necessary to run the program, i mostly go for pyarmor or i'm converting the source to .pyd
Wish I could help you bro but idk what that shit is xD
I'm assuming you're needing to pack Python code into a Windows PE for compact portability. The existing options are popular for a reason: they're essentially the only ones out there. As an additional step, you could pack the WinPE with something like UPX, but that is extremely common among the purpose. Python isn't meant to be shipped/exchanged as near-unreadable code. The readability aspect of Python was taken into account as a major focus for a reason, and (as far as I'm concerned; too lazy to e-mail and ask the developers of the language) that's not meant to change from source to any other form.

If you're wanting to pack Python code into a WinPE with a tiny Python interpreter (via aforementioned packers) in some attempt to protect the source code, you've no use for Python and would be better off using some language more fit for the task. I.e. a language which compiles to native. That is the straightest-forward process in protecting source code. Compiling code to processor/memory instructions makes it near impossible to tell what a program is doing (specifically, at least). Both C and C++ work great for this. Rust is a close competitor, albeit more "memory safe" (which you can do yourself when programming C/C++).

tl;dr (in either case)
https://www.cprogramming.com/tutorial/c-tutorial.html
https://jmeubank.github.io/tdm-gcc/ (Windows)
https://gcc.gnu.org/ (Mac/Linux)

If neither of my assumptions are correct, let alone close to what purpose you have in doing this, let me know. Yes, post here. I've zero clue why so many people ask to PM me for questions of any sort. Post it here in your thread. That way other/future board members can find the answer(s) for the same question.
[Image: chain.png]
(Jun 5, 2021 09:44 PM)SIM-4791248 Wrote:  i tried all public tools once again [ auto py to ee - py2exe...Etc ] Python 3.9 🤣

any clear or solid solutions yet?? my program include tkinter GUI wich never run after compiling 🤦‍♂️

Thanks again

https://medium.com/lifeandtech/executabl...79562a5558 😉
try pip install pyinstaller and pip install auto-py-to-exe
then open cmd agn and type auto-py-to-exe, from there you'll 100% know what to do!
good luck!
Python is an interpreted language, not a compiled language. This means that instead of being compiled to machine code which is understood by the computer, python code is passed through a separate program known as an interpreter. This means that if you want a standalone windows executable, you will have to pack the entire python interpreter along with any external modules your program uses (in this case tkinter). This will never be efficient and your executable will end up being huge.

Out of all the tools that do this for you, I have had the most success with pyinstaller. You may want to enable the no upx flag because that fixed some problems I was having with it, but keep in mind python really wasn't made for portable desktop applications.
Pyinstaller but you'll have to include every library otherwise it won't work.
You should check nuitka compiler.
Might wanna consider learning to use Visual Studio and learning C# if you're wanting to create compiled executable programs. Just a tip.l
(Jun 11, 2021 03:18 PM)Doc Wrote:  Might wanna consider learning to use Visual Studio and learning C# if you're wanting to create compiled executable programs. Just a tip.l

[Image: IQPvf1x.jpg]
[Image: chain.png]
(Jun 8, 2021 06:58 AM)Doomslayer Wrote:  Python is an interpreted language, not a compiled language.

Languages are not interpreted or compiled. Implementations of them are.
So I went through this issue a while back, and while it's a different version the general method should work. I would try using PyInstaller as it's the best option I've found and has a variety of different ways of compiling. Sometimes libraries don't do well but PyInstaller usually does a good job of resolving things.
(Jun 13, 2021 07:25 AM)tsuki Wrote:  Languages are not interpreted or compiled. Implementations of them are.

If the implementation of a language is using a compiler, then it is referred to as a compiled language. If the implementation of a language uses an interpreter, it's referred to commonly as an interpreted language.

While I see why you're technically correct, there was nothing really wrong with Doomslayer's explanation.
[Image: Iu0EfTL.gif]
(Jun 16, 2021 12:50 PM)Lindros Wrote:  If the implementation of a language is using a compiler, then it is referred to as a compiled language. If the implementation of a language uses an interpreter, it's referred to commonly as an interpreted language.

While I see why you're technically correct, there was nothing really wrong with Doomslayer's explanation.

I think what he was getting at is that there's no reason you can't compile Python.

You are right, the reference implementation of Python (the one from python.org) is interpreted, but of course languages are simply just a collection of rules and syntax. Implementations like Cython are an ecosystem for extending the existing Python language (in both syntax and functionality) as well as providing a transpiler (from Python to C) which allows you to compile the source code into a static executable.
SRPP Discord Server

I am a professional network/cloud security architect.
My Old Tutorials


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Source] by chochochaNov 10, 2025 09:11 AM 1 136 Nov 10, 2025 09:11 AM
Last Post: MavenGradle
[Python] by Bass_ReevesAug 20, 2023 01:44 AM 9 630 Aug 20, 2023 01:44 AM
Last Post: Lucky4L
[.NET] by DrpriyaOct 4, 2022 11:17 PM 4 328 Oct 4, 2022 11:17 PM
Last Post: LeetSpeed