Tutorial Setup and Build
This is basic steps if you have nothing installed, of course if you have any of the parts, just skip it. Download and install Python from https://www.python.org/downloads/windows Select one of Verify it’s working using command Verify using command make a python file named hello.py Do as you normally would. Running Nuitka on code that works incorrectly is not easier to debug. Note This will prompt you to download a C caching tool (to speed up repeated compilation of generated C code) and a MinGW64 based C compiler, unless you have a suitable MSVC installed. Say Execute the To distribute, build with You may also try Setup
Install Python
Windows x86-64 web-based installer
(64 bits Python, recommended) or x86 executable
(32 bits Python) installer.python --version
.Install Nuitka
python -m pip install Nuitka
python -m nuitka --version
Write some code and test
Create a folder for the Python code
mkdir
HelloWorlddef talk(message):
return "Talk " + message
def main():
print(talk("Hello World"))
if __name__ == "__main__":
main()
Test your program
python hello.py
Build it using
python -m nuitka hello.py
yes
to both those questions.Run it
hello.exe
created near hello.py
.Distribute
--mode=standalone
option, which will not output a single executable, but a whole folder. Copy the resulting hello.dist
folder to the other machine and run it.--onefile
which does create a single file, but make sure that the mere standalone is working, before turning to it, as it will make the debugging only harder, e.g. in case of missing data files.