Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Answer

Open a command line (Windowskey+R⊞ Win+R, 'cmd'cmd,<enter>↵ Enter) and type 'python -V'python -V, <enter>↵ Enter.

You should get a response back, something like 'Python 2.7.1'Python 2.7.1.

If you do not, you may not have Python installed. Fix this first.

Once you have Python, your batch file should look like

@echo off
python c:\somescript.py %*
pause

This will keep the command window open after the script finishes, so you can see any errors or messages. Once you are happy with it you can remove the 'pause' line and the command window will close automatically when finished.

Open a command line (Windowskey+R, 'cmd',<enter>) and type 'python -V', <enter>.

You should get a response back, something like 'Python 2.7.1'.

If you do not, you may not have Python installed. Fix this first.

Once you have Python, your batch file should look like

@echo off
python c:\somescript.py %*
pause

This will keep the command window open after the script finishes, so you can see any errors or messages. Once you are happy with it you can remove the 'pause' line and the command window will close automatically when finished.

Open a command line (⊞ Win+R, cmd,↵ Enter) and type python -V, ↵ Enter.

You should get a response back, something like Python 2.7.1.

If you do not, you may not have Python installed. Fix this first.

Once you have Python, your batch file should look like

@echo off
python c:\somescript.py %*
pause

This will keep the command window open after the script finishes, so you can see any errors or messages. Once you are happy with it you can remove the 'pause' line and the command window will close automatically when finished.

Source Link
Hugh Bothwell
  • 57k
  • 9
  • 91
  • 103

Open a command line (Windowskey+R, 'cmd',<enter>) and type 'python -V', <enter>.

You should get a response back, something like 'Python 2.7.1'.

If you do not, you may not have Python installed. Fix this first.

Once you have Python, your batch file should look like

@echo off
python c:\somescript.py %*
pause

This will keep the command window open after the script finishes, so you can see any errors or messages. Once you are happy with it you can remove the 'pause' line and the command window will close automatically when finished.

lang-py

AltStyle によって変換されたページ (->オリジナル) /