top of page

How to convert Python file (example.py) to an executable (example.exe) ?


1. Open Command Prompt and navigate to the folder where .py file is located. For those of you who are unaware of how to navigate, use 'cd path' command.

2. Run 'pip install pyinstaller'.

3. Once pyinstaller is successfully installed, you can run 'pyinstaller --onefile -w example.py'

4. Two folders will be created in the directory - dist and build

5. EXE file will be in the dist folder.


# We often need our python scripts to run on other machines, but when the other machine doesn't have Python installed, it is recommended to create a .exe file and share it to the target machine. This way, the other machine can run the scripts without Python.






Recent Posts

See All
Numpy in a nutshell

Numpy arrays are closer to hardware. Thus, their execution/operation times are significantly lesser compared to the usual pythonic lists....

 
 
 

Comments


©2019 by thecuriousfolk.com

bottom of page