安装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).