Python 编辑器 tips
1. IDLE界面美化
注意IDLE是可以设置语法高亮的;(美化参考 http://www.linuxidc.com/Linux/2012-07/66129.htm)
windows 用户,直接打开 开始运行 或者在地址栏输入下面的路径确认即可: %USERPROFILE%\.idlerc\
确认是否有config-highlight.cfg,没有新建一个。编辑或者复制下面内容后保存。
[Obsidian] definition-foreground = #678CB1 error-foreground = #FF0000 string-background = #293134 keyword-foreground = #93C763 normal-foreground = #E0E2E4 comment-background = #293134 hit-foreground = #E0E2E4 builtin-background = #293134 stdout-foreground = #678CB1 cursor-foreground = #E0E2E4 break-background = #293134 comment-foreground = #66747B hilite-background = #2F393C hilite-foreground = #E0E2E4 definition-background = #293134 stderr-background = #293134 hit-background = #000000 console-foreground = #E0E2E4 normal-background = #293134 builtin-foreground = #E0E2E4 stdout-background = #293134 console-background = #293134 stderr-foreground = #FB0000 keyword-background = #293134 string-foreground = #EC7600 break-foreground = #E0E2E4 error-background = #293134 [tango] definition-foreground = #fce94f error-foreground = #fa8072 string-background = #2e3436 keyword-foreground = #8cc4ff normal-foreground = #ffffff comment-background = #2e3436 hit-foreground = #ffffff break-foreground = #000000 builtin-background = #2e3436 stdout-foreground = #eeeeec cursor-foreground = #fce94f hit-background = #2e3436 comment-foreground = #73d216 hilite-background = #edd400 definition-background = #2e3436 stderr-background = #2e3436 break-background = #2e3436 console-foreground = #87ceeb normal-background = #2e3436 builtin-foreground = #ad7fa8 stdout-background = #2e3436 console-background = #2e3436 stderr-foreground = #ff3e40 keyword-background = #2e3436 string-foreground = #e9b96e hilite-foreground = #2e3436 error-background = #2e3436
然后重启IDLE, options-> Configure IDLE -> Highlighting ->
2.Pycharm
Pycharm 是专门用于python编辑的 IDE工具,和Inteligen 是同一家公司,同为收费产品。
正在寻找破解版的安装,晚点记录于此。
3. 快捷键:
Tab键可以一次缩进(用空格太low,太不专业了);
选中代码开头和结尾,Tab键可以同时全部向右缩进;
Shift和Tab键,可以回退缩进(向左)。
4. Pycharm编译:
一般并不能直接运行,要有main函数。
有main函数时,右键会出现run NiDeJiaoben。
if __name__ == "__main__": print "What's you name?"
#将引号里面的东西换成你自己的函数调用,即可独立运行得到结果
#这里的if __name__=="__main__" 用于判断这个脚本是独立运行,还是被作为模块导入到别的脚本的
5. Pycharm 显示行号和调整字体大小
posted on
2016-04-19 16:17 Suckseedeva 阅读(
...) 评论(
...) 编辑 收藏