如何打开记事本++;windows powershell中的python文件?
我目前正在通过Zed Shaw的《艰难地学习python》一书学习python。我学习了windows powershell的功能,现在我将继续学习其他课程。(关于第1课) 听起来很傻,但在windows powershell中打开保存的python notepad++文件时遇到了问题。我正在使用命令:如何打开记事本++;windows powershell中的python文件?,python,Python,我目前正在通过Zed Shaw的《艰难地学习python》一书学习python。我学习了windows powershell的功能,现在我将继续学习其他课程。(关于第1课) 听起来很傻,但在windows powershell中打开保存的python notepad++文件时遇到了问题。我正在使用命令: python ex1.py 该文件与python和notepad++一起保存到我的桌面上。该文件是一个保存的notepad++文件,应该在powershell中运行并打印我写的内容(“hel
python ex1.py
该文件与python和notepad++一起保存到我的桌面上。该文件是一个保存的notepad++文件,应该在powershell中运行并打印我写的内容(“hello world”)。相反,我收到以下错误消息:
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 if the path is correct and try again.
所以在书中,当Zed Shaw这样做时,它会在powershell中运行程序。可能我的路径已关闭?Windows无法识别“python”为有效命令(基于错误消息)。你需要修正你的路径
显式输入路径 c:\Python27\python.exe foo.py
(按韦德的方式做,从长远来看会更好)。这与powershell或记事本++无关。。基本上,您无法执行python代码。。无论您在何处安装python/希望它以何种方式运行,都需要进行检查。