I need to convert a Python script to a Windows executable.
I have Python 2.6 installed to
I have created one script and kept it in
C:\pythonscript. Inside this folder there are two files
oldlogs.py (this file need coversion)
setup.py code is
from distutils.core import setup import py2exe setup(console=['oldlogs.py'])
How can I convert oldlogs.py to an exe file?
Here is how one could fairly easily use PyInstaller to solve the issue at hand:
From the tool's documentation:
PyInstaller analyzes myscript.py and:
- Writes myscript.spec in the same folder as the script.
- Creates a folder build in the same folder as the script if it does not exist.
- Writes some log files and working files in the build folder.
- Creates a folder dist in the same folder as the script if it does not exist.
- Writes the myscript executable folder in the dist folder.
In the dist folder you find the bundled app you distribute to your users.