Python Forum

Full Version: I love the simplicity of Python but have a question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Can Python code be compiled as an EXE say to run inside a Win Console window?

Jeff
yes you can with numerous tools. PyInstaller has probably become the best lately.
https://python-forum.io/Thread-Building-...ith-Py2exe
It's not exactly compiling, but there are applications that can create an .exe out of a Python program.
Yes,probably the best today is pyinstaller work Python 3.7.
There are several other,but eg py2exe did stoop develop at Python 3.4.
pynsist is packed a installer,also a GUI installer window with the normal next --> next until installed.
Quote:It's not exactly compiling, but there are applications that can create an .exe out of a Python program.

How do they do that? For instance Python allocates enough memory to store a number (correct me if I'm wrong) as it gets it at runtime.

But if it were compiled, and I type a 90 digit number then the code would break..
The executable binary file includes the interpreter and dependencies, if you prefer a one-file-executable. The interpreter runs the embedded Source Code or Byte Code.
It's still dynamic typed.
Python, initially seems to bo the language I wish to learn. Just want to be able to share code(program) with another user who doesn’t have to execute a scrip with python on their computer.

I have a need to develop utility style programs to work with computations that output to simple text files.

Jeff