简体   繁体   English

如何运行Python脚本(使用Notepad ++)

[英]How to Run Python Scripts (using Notepad++)

I recently started following this tutorial on how to make a roguelike with Python. 我最近开始按照本教程讲解如何使用Python制作类盗贼。 I have the first part of the code written(posted below) that draws and lets you control the player, but I'm not sure how exactly to run this and test it out. 我已经编写了代码的第一部分(在下面发布),它可以绘制并允许您控制播放器,但是我不确定如何准确地运行它并对其进行测试。 Also, I have Python installed, and I'm using Notepad++. 另外,我已经安装了Python,并且正在使用Notepad ++。 Can someone help to figure out how to run my .py scripts? 有人可以帮忙弄清楚如何运行我的.py脚本吗?

Download the plugin PyNPP it will help with development in Notepad ++ haven't played with it too much though. 下载插件PyNPP,它不会对Notepad ++的开发产生太大的帮助。 Has options to customize your run options. 具有用于自定义运行选项的选项。 Has a shortcut as well to launch quickly. 还有一个快速启动的快捷方式。

Hope this helps. 希望这可以帮助。

As the first comment says, type python myscript.py into the commandline. 如第一条评论所述,在命令行中键入python myscript.py

It may be worth familiarising yourself with command line before trying your hand at programming; 在尝试编程之前,可能需要熟悉命令行。 it's not particularly hard, and learning it all at once will be easier than learning the bits and pieces you need as they come up. 这并不是特别困难,并且一次学习所有内容比学习需要的点点滴滴要容易得多。

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

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