Earlier I used to code in python well, but after I formatted my computer and reinstalled the same python setup, my os.system
command stopped working, as well as subprocess.Popen
.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Looks like a path issue. The only way I could reproduce that -1 error was by setting my path to nothing so that Python couldn't find cmd.exe.
Here's a link I ran across by searching for "set windows path" in stack exchange:
http://support.microsoft.com/kb/310519
It tells how to set it for Winddows XP, the procedure is pretty much the same in later versions in that you're basically setting up environment variables which are stored in the registry.