Unix システムなどの Windows コンソールで Python スクリプトを直接実行する方法はありますか?
#! /usr/bin/env python3.3
または、Python スクリプトとしても機能する .BAT ファイルを作成します。
@echo off
rem = '''
echo This is "%~f0" before Python
python -x "%~f0" %*
echo This is "%~f0" after Python
goto :end
'''
print "------------- Python code starts here --------------"
import sys
print sys.path
print sys.argv
print "------------- Python code ends here ----------------"
rem = '''
:end
rem '''