Notepad++配置Python开发环境

 

安装Python

 

1 下载

我选择了32位的2.7版本。https://www.python.org/ftp/python/2.7.8/python-2.7.8.msi

2. 安装

安装的时候可以修改安装路径到D盘,然后注意一点是可以将最后一项“配置环境变量”勾选上(默认是不选择的),这样就不用手动配置环境变量了。

 

 

 

 

使用Notepad配置python开发环境

1. Notepad++ ->"运行"菜单->"运行"按钮

2. 在弹出的窗口内输入以下命令:

 

cmd /k cd /d "(CURRENT_DIRECTORY)" &  python "(FULL_CURRENT_PATH)" & ECHO. & PAUSE & EXIT

后来在别的网页上看到,需要加上“$”符号,不然不识别(CURRENT_DIRECTORY)和(FULL_CURRENT_PATH)这些变量cmd /k cd /d "$(CURRENT_DIRECTORY)" & python "$(FULL_CURRENT_PATH)" & ECHO. & PAUSE & EXIT

 

 

 

然后点击“保存”,随意取一个名字,比如“RunPython”,为方便,配置一下快捷键(比如 Ctrl + F5),点OK即可。之后运行Python文件只要按配置的快捷键或者在运行菜单上点“RunPython”即可。

 

 

Notepad++宏定义的含义

可以参考Notepad++自带的帮助文档。

点击“?”菜单->“帮助”按钮(或者Shift+F1快捷键)->在打开的页面中点击右面的“Commands”,可以查看到各个宏定义的含义

复制代码

FULL_CURRENT_PATH
  the fully qualified path to the current document.
CURRENT_DIRECTORY
  The directory the current document resides in.
FILE_NAME
  The filename of the document, without the directory.
NAME_PART
  The filename without the extension.
EXT_PART
  The extension of the current document.
NPP_DIRECTORY
  The directory that contains the notepad++.exe executable that is currently running.
CURRENT_WORD
  The currently selected text in the document.
CURRENT_LINE
  The current line number that is selected in the document (0 based index, the first line is 0).
CURRENT_COLUMN
  The current column the cursor resides in (0 based index, the first position on the line is 0).

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值