How to run self-contained Python scripts who don't need Python installation?

Michael Torrie torriem at gmail.com
Thu Jun 8 22:56:44 EDT 2017


On 06/08/2017 07:40 PM, Juan C. wrote:
> 2. I'd like to create a simple BAT to run my Python script, so there
> would be only 2 things (a 'dist' folder with everything and a run.bat
> to make it clear what should be run), for example:

Sure you can. You just have to do it like this (untested; I haven't used
Windows in many years):

@echo off

start %~dp0dist\python-3.6.0-embed-win32\python.exe %~dp0dist\app.py %*

I think %* expands to all the commandline parameters, apparently
excluding %0, which would be the command name itself.








More information about the Python-list mailing list