PyChram使用技巧总结

1.1 下载
  官网
1.2 汉化

1.3 添加或者修改文件模板
  File->settings->Editor->File and Code Templates->Python Script

#!/usr/bin/env python
# encoding: utf-8

#set( $SITE = "http://madsstudy.blog.51cto.com/" )
"""
@version: v1.0
@author: 杩栋胜
@license: Apache Licence
@contact: 1455975151@qq.com
@site: ${SITE}
@software: ${PRODUCT_NAME}
@file: ${NAME}.py
@time: ${DATE} ${TIME}
"""

def func():
    pass

class Main():
    def __init__(self):
        pass

if __name__ == '__main__':
    pass
Python模板


1.4 python版本管理切换
  File->settings->Prgject:python->project interpreter

1.5 已有文件重命名
  右击要重命名的文件->refactor->rename

1.6 Python模块安装
  File->settings->Prgject:python->project interpreter
  安装、升级、卸载模块均可

1.7 在PyChram中直接浏览文件目录
  右击文件选择show in explorer

1.8 断点调试
     1)打断点

     2)使用debug模式运行程序   run->Debug


1.9 常用快捷键

alt+ctrl+s           # 打开设置界面
tab                 # 选择要缩进的代码,按键缩进
shift+tab            # 选择要缩进的代码,按键增加
ctrl+d               # 复制本行粘贴到下一行
ctrl+/ # 注释/取消注释
Ctrl + R # 替换
Ctrl + F # 查找 Ctrl + Shift + F # 全局查找 Ctrl + Shift + R # 全局替换

1.10 PyChram设置字体大小
步骤:Settings-->Editor-->Colors & Fonts-->Font,然后在size那里调整。
注意,要先保存一个新的Scheme,才能调整字体大小。

 

1.11 直接运行当前的.py文件

File->setting->keymap->other->run context configuration,windows下设置为Ctrl+R,mac下设置command+R

 

1.12 格式化代码

File->setting->keymap->main menu->code->reformat code,设置为 Ctrl+shift+L

 

1.13 智能感知忽略大小写

File->setting->Editor->Code Completion->case sensitive completion->选择None

最全的使用介绍:http://blog.csdn.net/u013088062/article/details/50214459

posted @ 2016-05-14 08:51  每天进步一点点!!!  阅读(2343)  评论(1编辑  收藏  举报