繁体   English   中英

你如何在Windows PowerShell中打开一个notepad ++ python文件?

[英]How do you open a notepad++ python file in windows powershell?

我目前正在通过Zed Shaw的“学习Python困难之路”这本书学习python。 我现在学习了windows powershell的功能,我正在学习其他课程。 (在第1课)

听起来很傻我在Windows PowerShell中打开一个保存的python notepad ++文件时遇到了麻烦。 我正在使用命令:

python ex1.py 

该文件与python和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”识别为有效命令(基于错误消息)。 你需要修复你的路径。

  1. 找到python程序的安装位置
  2. 将其添加到您的系统路径
  3. 刷新你的shell

明确输入路径..

c:\\ Python27 \\ python.exe foo.py

(从长远来看,它是否会以更好的方式)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM