将Notepad++配置为Python编译器

上传人:人*** 文档编号:421748172 上传时间:2023-07-29 格式:DOCX 页数:11 大小:583.29KB
返回 下载 相关 举报
将Notepad++配置为Python编译器_第1页
第1页 / 共11页
将Notepad++配置为Python编译器_第2页
第2页 / 共11页
将Notepad++配置为Python编译器_第3页
第3页 / 共11页
将Notepad++配置为Python编译器_第4页
第4页 / 共11页
将Notepad++配置为Python编译器_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《将Notepad++配置为Python编译器》由会员分享,可在线阅读,更多相关《将Notepad++配置为Python编译器(11页珍藏版)》请在金锄头文库上搜索。

1、效果图:将Notepad+配置成为脚本编译器Made by Marslo on Feb 34 2012配置方法(以 Python 为例):1.安装插件:打开 notepad+,选择 Plugins - Plugin Manager Show Plugin Manager选择 Available - NppExec -InstallAvailable Updates Installed-)CategoryAvailable Version StabilityObideMNppJumpListNppNetf-JoteOberon-2 LexerNotepad#NppAutoIndentNppCry

2、ptPlugin ManagerPIL口 回Others09斗GoodOthers1.2GoodOthers1.0.0.7GoodOthers0.4.1GoodOthers1.2.2GoodOthers0.1GoodOthers0.3.1GoodOthers2.3.2GoodGthpr?7.1Q4Gnnririnpn Filp Tn SJnlutinn单击 Yes 自动重启 Notepad+Plugin Manager j Some installation steps still need to be completed. Notepad+ needs to be restarted in

3、order to 匚omplete these steps. If you restart later, r/ you will be prompted agaiin. Would you like to restart now?厂?Yes!No1如果等了很久都没有重启的同学,请单击OKValue cannot be null. Parameter name: inputUri2. 配置 NppExec:打开 Plugins - NppExec - Execute 或者直接按下 F6在弹出的Execute 窗口中粘贴:npp_saveCD $(CURRENT_DIRECTORY) $(FULL

4、_CURRENT_PATH)需要注意的是,1. :表示安装在你本机的python的路径,一定要带python.exe,例如我的路径:C: Python26python.exe2. 如果给 python 添加了环境变量的,可以直接使用 python 即可,像截图上一样。使用的方便在于,如果你安装了好几个版本的python,那么可以通过 不同的路径来编译不同版本的脚本,单击Save 且在Script name窗口中添加命令的名字(名字可以随意取)- Save - Ok3. 给命令加快捷键:选择 Plugins - NppExec - Advanced OptionsQf D:MarsloStudy

5、ScriptPython2012.02.24tst.py - Notepad+ +耳罔File Edit Search View Encoding Language Settings Macro Run Plugins Vwindow ?B tst.py |卜 叵E 回届Comparer.n nvertsr卜 123斗5678910111213141516171819202122232425262728 def getListSim(ll): flag_digit = 0 flag_list = 0fn-LD-nifPython fileif list 1= type(ll): dic-rff

6、lag-lisf = 1 return Falseelse:for i in range(lenCll): if int 1= typeCHEiB: dic-rfflag-digit = 1 return Falseif 0 = flag_digit: dic_rETsumT = sumfll) return True_name = _ ain:1 = 口,2, 3, 4, 5NppExecNppExport卜NppFTPPlugin ManagerPython Script卜SnippetPlus卜Spell-Checker卜Help/ManualHelp/Docs.Help/About.v

7、 Console Commands History Console Output. (UTF8/UTFS No internal messagesv Save all files on execute# Follow S(CURRENT_DIRECTORY) Disable comimand aliasesChange Console Font.匸m*i弐口1巴 Output Filter弐Advanced Options.Execute.Direct Execute Previous Show Console Dialog Toggle Console Dialogdic_r = Tflag

8、_listT: 0, Tflag_digit: Q, TsumT: 0 res = getListSumCl)if False = res:if 1 = dic_rflag_listT:print Parameter is not a List!Tel if 1 = diC-rC flag-digit1:print There are exisnon-digit type in the list! elif True = res:print The summary of I is: + strfdic_rsunT)length : 6&0 lines : 28Ln : 19 Col : 56

9、Sei : 0F6Ctrl+F6Ctrl+DosWindows ANSIINS先勾选 Place to the Macros submenu然后在Associated script的下拉列表中选择自己已经定义的命令名称,单击Add/Modify,这 时自己定义的命令已经添加到了上边的框中单击OK - OK ,然后手动重启Notepad+选择 Settings - Shortcut Mapper打开Plugin commands标签,找到自己定义的命令,选择Modify,或者直接双击在弹出的Shortcut窗口上选择自己喜欢的快捷键去触发这个命令(不要重复了),单击OK Close4个性配置89

10、10111213141516171819202122232425262728File Edit Search View En coding Language Settings Macro Run Plugins Window ?Q田圄晉舄尷旦I韜电岔e胡如 寒占|迟盅| th圉囲|剛回国画最 闫 tst.py |else:for i in rangeClenCll): if int != typeCHEi): dic_rTflag_digitT = 1 return Falseif 0 = flag_digit: dic_rTsumT = sumCll) return True if name

11、 = _ ain:1 = 口,2, 3,斗,5dic_r = Tflag_lisf: 0, Tflag_digitT: 0, sum: 0 res = getListSumCl)if False = res:if 1 = dic_rEflag_listT: print Tarameter is not a ListlTel i f 1 = dic-rfflag-digif:print There are exisnon-digit type in the listlTelif True = res:| ConsoleNPP_EXEC: run-pythonNPP_SAVE: D: 1arslo

12、StudyScriptython2012.02.24tst. py CD: D: larslQtLidycriptythonO 12.02.24Current directory: D: VlarslotudyScriptythonVO 12.02.24 python T): VarslotudycriptVython 12.02.24tst.py* Process started The summary of 1 is: 15 Process finished.READY Python filelength : 6&0 lines : 28Ln : 28 Col : 58 Sei :0DosWindowsANSIINSprint TThe summary of I is: TConsole 默认的效果是白色的底色,看起来很不好看,但是可以根据自己的情况,配置参数按下你自己选择的快捷键享受NppExec带来的方便快捷吧!

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文 > 其它学术论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号