Python On Windows

How to Install Python on Windows

Windows batch file that runs Python interpreter, Python script, ...

(Double click on a "bat" file to execute it)

Create this bat file (abc.bat)

@echo off
rem =============================================================
rem run the Python 27 interpreter
rem =============================================================
rem to execute a Python script (abc.py) while in the interpreter
rem    %PYTHON%
rem    >>> execfile("abc.py")
rem -------------------------------------------------------------
rem to use the Python launcher (in a cmd window)
rem    py -2
rem -------------------------------------------------------------
rem to execute a Python script (abc.py)
rem    %PYTHON% abc.py
rem =============================================================

echo.
echo Running the Python interpreter
echo.

set PYTHON="C:\Python27\python27.exe"

%PYTHON%

pause

Note: rem (remark?) is a bat file comment