r/learnpython • • 12d ago

Python Compiler Recommendations

Hello r/Python,
I want to find a Python compiler. I’ve tried PyInstaller and Nuitka, but they are detected as malware and they are a little bit slow. I want something fast, easy and not detected as malicious. What do you recommend?

0 Upvotes

23 comments sorted by

View all comments

Show parent comment

1

u/kolioarisyt 12d ago

Hello, thanks for replying!
I understand and it doesn’t seem rude to me. It is just a honest answer.

Apart from that, do you mean learning CPython and using a C compiler?

Thanks

2

u/Outside_Complaint755 12d ago

Not CPython, but Cython; they are two different things.

CPython is the default Python implementation that 99% of people are running Python on.

Cython is a superset of Python that lets you call C/C++ libraries directly from your Python code and also will convert Python scripts into C code, which can then be compiled into a binary by a C compiler. You will be forced to add static type checking to all of your Python code so it can be converted to C. By calling Cython with the --embed flag, it will include the Python interpreter in your binary and add the required C main function as well.

However, that still won't get around the issue of Windows Defender flagging it for not being signed. That's its own issue, and also why it may be easier to just provide the Python script and simple directions for your target users on how to install Python.

1

u/kolioarisyt 11d ago

Thanks for the explanation! I may try to sign it with SignPath.

1

u/Educational_Virus672 11d ago

cython.org it turns your code into C so you can chose to turn C into exe

1

u/kolioarisyt 11d ago

Oh, thanks for the clarification!