怎么打开pythonshell_如何在Powershell中运⾏python程序?我试图从Powershell运⾏python,然后使⽤cd f:\python27
如果输⼊python,则会得到以下错误(尽管它是⽂件夹中的exe⽂件):python : The term 'python' is not recognized as the name of a cmdlet, function,
script file, or operable program. Check the spelling
of the name, or if a path was included, verify that the path is correct and try
again.
At line:1 char:1
+ python
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (python:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command python was not found, but does exist in the
current location. Windows PowerShell does not load commands from the current
location by default. If you trust this command, instead type: ".\python". See "get-
help about_Command_Precedence" for more details.
如果我输⼊.\Python,它就什么也不做,并再次返回提⽰符。我在⽂本编辑器中创建了⼀个名为helloworld.py的简单⽂件,并将其保存到python 27⽬录中,其中包含⼀⾏:
输出“你好世界!”powershell创建目录
我试着打字python helloworld.py
.\python helloworld.py
第⼀个返回原始错误,第⼆个返回提⽰,显然没有做任何事情,我⽆法让python程序运⾏。 有⼈能帮我或指出我哪⾥出了问题吗?
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论