Python IDE 编辑器:PyCharm

Python IDE 编辑器:PyCharm

PyCharm 是由Jetbrains公司开发的Python集成开发环境(IDE),支持调试、语法高亮、Project管理、代码跳转、自动完成、单元测试、版本控制等常用功能。

一.      PyCharm的安装

PyCharm 是由Jetbrains公司开发的Python集成开发环境(IDE),支持调试、语法高亮、Project管理、代码跳转、自动完成、单元测试、版本控制等常用功能。

1. 从我的网盘下载,双击进行安装

链接:https://pan.baidu.com/s/1BCzQm6uAfv2hDa2YwVG_qA 密码:z3yk

一直点Next到完成。

2. 安装完成然后注册

二.      PyCharm的配置

PyCharm的配置入口:File->settings->

1. 设置“显示行号” File->settings->Editor->General->Appearance->勾选 Show Line Numbers,点击OK

 

或者在编辑器右边区域右键勾选Show Line Numbers

 

2. 修改字体大小

点工具栏上的 settings 按钮 或者从 file-》settings。

Editor -》 Colors & Fonts -》Font ,  Scheme name 默认是不能修改的,需要点 Save AS 之后,就可以修改 Size 的大小,改之后,点Apply 保存即可。

 

3. 编码格式的设置

File->settings->Editor->File Encodings

 

4. templates 设置

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

第一种设置:

加以下内容:

比如作者和创建时间

__author__ = '$USER'

 

第二种设置:

File-Settings-Editor-File Code Templates 配置Python Script模板文件;

关于Templates一些参数变量详解:

${PROJECT_NAME} - the name of the current project.

${NAME} - the name of the new file which you specify in the New File dialog box during the file creation.

${USER} - the login name of the current user.

${DATE} - the current system date.

${TIME} - the current system time.

${YEAR} - the current year.

${MONTH} - the current month.

${DAY} - the current  day of the month.

${HOUR} - the current hour.

${MINUTE} - the current minute.

${PRODUCT_NAME} - the name of the IDE in which the file will be created.

${MONTH_NAME_SHORT} - the first 3 letters of the month name. Example: Jan, Feb, etc.

${MONTH_NAME_FULL} - full name of a month. Example: January, February, etc.

配置实例:

 

三.      PyCharm的使用

1. 新建项目

File->New Project->

 

Location: 选择项目的目录

Interpreter:选择运行的Python脚本的版本

2. 运行程序

方法一:

右键->点运行

 

方法二:

快捷键 : Shift+F10

方法三:

点工具栏上的运行按钮

 

3. 整行复制

四.       PyChram常用快捷键

alt+ctrl+s     # 打开设置界面

tab             # 选择要缩进的代码,按键缩进

shift+tab       # 选择要缩进的代码,按键增加

ctrl+d           # 复制本行粘贴到下一行

ctrl+?     #选择要添加注释的行,按键进行#添加或去除

双按shift  #全局搜索

ctrl+/     #注释

ctrl+F    #查找

ctrl+R   #查找替换

Shift+F10      #运行

猜你喜欢

转载自www.cnblogs.com/tinghai8/p/9031206.html