Pycharm 使用技巧总结


title: Pycharm 使用技巧总结

  • 添加或者修改文件模板
    • File->settings->Editor->File and Code Templates->Python Script
  • python版本管理切换
    • File->settings->Prgject:python->project interpreter
  • 已有文件重命名
    • 右击要重命名的文件->refactor->rename
  • Python模块安装
    • File->settings->Prgject:python->project interpreter
  • 在PyChram中直接浏览文件目录
    • 右击文件选择show in explorer
  • 断点调试
    • 打断点
    • 使用debug模式运行程序 run->Debug
  • 常用快捷键
    • alt+ctrl+s    # 打开设置界面
    • tab      # 选择要缩进的代码,按键缩进
    • shift+tab    # 选择要缩进的代码,按键增加
    • ctrl+d    # 复制本行粘贴到下一行
    • ctrl+/ # 注释/取消注释
    • Ctrl + R # 替换
    • Ctrl + F # 查找
    • Ctrl + Shift + F # 全局查找
    • Ctrl + Shift + R # 全局替换
  • PyChram设置字体大小
    • 步骤:Settings-->Editor-->Colors & Fonts-->Font,然后在size那里调整。
    • 要先保存一个新的Scheme,才能调整字体大小。
  • 直接运行当前的.py文件
    • File->setting->keymap->other->run context configuration,windows下设置为Ctrl+R,mac下设置command+R
  • 格式化代码
    • File->setting->keymap->main menu->code->reformat code,设置为 Ctrl+shift+L
  • 智能感知忽略大小写
    • File->setting->Editor->Code Completion->case sensitive completion->选择None

你可能感兴趣的:(Pycharm 使用技巧总结)