I would like a user on Windows to be able to run my Python program, so I want to convert it to a .bat file. Is there a way to convert it? I’ve tried searching, but didn’t find anything.
I would like a user on Windows to be able to run my Python
Share
Unless your script is trivial it will not be possible to ‘translate’ it into a batch file. However two options exist:
The first option is trivial. Simply create a batch file as so:
If you are in a corporate environment you could put a python installation on a network and create a batch file to run the script from there. Otherwise you will need the user to install python. If python is on their path then the batch file can be simplified to:
Alternatively, there are options available that attempt to compile scripts into .exe files. I’ve never had any success with them, but py2exe seems the most common.