Python基础【day01】:PyChram使用技巧总结(六)

本节内容

1、添加或者修改文件模板 
2、 python版本管理切换 
3、已有文件重命名
4、Python模块安装
5、在PyChram中直接浏览文件目录
6、 断点调试
7、常用快捷键
8、PyChram设置字体大小
9、直接运行当前的.py文件
10、格式化代码
11、智能感知忽略大小写

1、添加或者修改文件模板  

File->settings->Editor->File and Code Templates->Python Script

#!/usr/bin/env python
# -*- coding: utf-8 -*-

2、 python版本管理切换 

 File->settings->Prgject:python->project interpreter

3、已有文件重命名

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

 4、Python模块安装

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

5、在PyChram中直接浏览文件目录

  右击文件选择show in explorer

6、 断点调试

     1)打断点

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

 7、常用快捷键

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

 8、PyChram设置字体大小 

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

9、直接运行当前的.py文件

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

10、格式化代码

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

11、智能感知忽略大小写

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

原文地址:https://www.cnblogs.com/luoahong/p/7240402.html