如何在notepad ++中运行python脚本? [英] How do you run a python script from within notepad++?

查看:306
本文介绍了如何在notepad ++中运行python脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用textmate时,我只需点击"apple + r",程序就会被解释.如何在记事本++中运行程序?我看到F5代表运行",但将其指向Python.exe只会打开一个运行python的终端.它不会运行我的脚本.

When I'm using textmate, I simply hit "apple+r" and the program gets interpreted. How can I run a program from within notepad++? I see that F5 is for "Run", but pointing that to Python.exe simply opens up a terminal with python running. It does not run my script.

推荐答案

插件 NppExec 执行( F6 )比普通运行( F5 ).通过插件,插件管理器安装NppExec.然后在 F6 中添加/保存以下内容:

Plugins NppExec Execute (F6) is much more powerful than plain Run (F5). Install NppExec via Plugins, Plugin Manager. Then in F6 add/save the following:

NPP_SAVE
cd "$(FULL_CURRENT_PATH)"
C:\Python34\python.exe -u "$(FULL_CURRENT_PATH)"

插件NppExec控制台输出过滤器( Shift + F6 ) 添加以下 HighLight 蒙版:

In Plugins NppExec Console output filters (Shift+F6) add the following HighLight mask:

*File "%FILE%", line %LINE%

确保已选中,例如红色并带有下划线.

Make sure it's checked, and make it e.g. red and underlined.

" F6 /execute"错误将突出显示并可以单击!

Upon "F6/execute" errors will be highlighted and clickable !

这可以在NPP568(可能更旧)中使用.

This works in NPP568, possibly older.

这篇关于如何在notepad ++中运行python脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆