So, you've made your fabulous program (calculator.py, for example) in the charming Python code style and you want to make it accessible to other pc where there is not Python installed or that you want to make other people that have no familiarity with Python. So, you need and exe file.
Here is what you have to do:
1) install py2exe
pip install exe
from the command line
2) create this setup.py file in a directory
from distutils.core import setup import py2exe setup(console=['calculator.py'])
3) Right click on the directory and choose "open the cmd from here" and the digit.
python setup.py py2exe
All the files you need will be created. What you need is the dist directory..
4) To make it easier to find the file to click on, create a file .bat with this text inside (let's assume the exe is called calculator and that you
@echo off
dist\calculator.exe
and you're done!
Comments
Post a Comment