Windows 命令行可以直接写test.py
运行python脚本,这本来是很好用的,但是使用时发现sys.argv
永远只有脚本本身的路径
经过搜索后结果果然是文件关联有问题:
You should check that in your registry the way you have associated the files is correct, for example:
[HKEY_CLASSES_ROOT\Applications\python.exe\shell\open\command]
@="\"C:\\Python27\\python.exe\" \"%1\" %*"