C:\Windows\System32>python C:\Users\邵\Desktop\1\hello.py
程序可以运行
C:\Windows\System32>C:\Users\邵\Desktop\1>python hello.py
拒绝访问。
第二个命令行没有进入该程序所在的文件夹,需要先cd道文件夹里才可以
简单来说,按照你两个命令行,
python路径为 C:\Users\邵\Desktop\1>python
hellp.py路径为: C:\Users\邵\Desktop\1\hello.py
前者可以运行 说明 python已添加环境变量可以使用或者python位于C:\Windows\System32路径下,以及hello.py在C:\Users\邵\Desktop\1\hello.py
后者我没搞明白 C:\Windows\System32>C:\Users\邵\Desktop\1>python hello.py
hello.py 又不在 C:\Windows\System32下为什么要这么运行?