Page 1 of 1

How to run python script using batch

Posted: 16 Aug 2014 12:23
by xhai
Hi there again..

I have a phython script named script.py everytime i want to use it i need to shift+right click mouse then navigate to open command window here / CMD then type the syntax "script.py -e filename"

Is there a way that a batch script can run a phython script, making it more easier

Thank you,

Re: how to run phyton script using batch

Posted: 16 Aug 2014 16:27
by ShadowThief
If the filename changes frequently:

Code: Select all

@echo off
set /p fname=Enter the full path of the file to use:
script.py -e "%fname%"


If the filename will never change:

Code: Select all

@echo off
script.py -e filename

Re: How to run python script using batch

Posted: 17 Aug 2014 13:05
by xhai
Thanks thief..

The code was so simple, but very useful