外观
Ctrl+滚轮改变字体大小:file -> Setting ->Editor-〉General -> Mouse
;
字体、颜色:file->settings->Editor
;
主题:file->settings->Editor->appearance->theme
注释颜色:File-->Settings-->Editor-->Color&Fonts-->LanguageDefaults-->Linecomment
工程和脚本
- 写脚本:新建工程,右击目录,新建python文件。
- 配置脚本模板:
file->settings->Editor->file and code template->python script
,在框中添加如下脚本:
#!/usr/bin/env python
# -*- coding:utf-8 -*-
- 运行:第一次运行右击脚本run,将脚本切换后再使用右上绿三角run。
- 第三方包安装:
File–>Settings–>Project–>Project Interpreter
,点击右侧的+号,进入搜索界面,寻找所需的包,然后点击安装。若不能安装成功,多数是因为网络被限制,需要在Manage Repositories
中修改数据来源,默认的是https://pypi.python.org/simple,可将其替换为国内的pip镜像:
清华:https://pypi.tuna.tsinghua.edu.cn/simple
阿里:http://mirrors.aliyun.com/pypi/simple/
豆瓣:http://pypi.douban.com/simple/
华中理工大学:http://pypi.hustunique.com/
山东理工大学:http://pypi.sdutlinux.org/
中国科学技术大学:http://pypi.mirrors.ustc.edu.cn/
另一种方法就是在命令行下安装轮子(*.whl)文件,如pip install numpy.whl
常用快捷键
ctrl + D
:复制当前行ctrl + y
:删除当前行shift + Enter
:快速换行ctrl + [
:跳到代码开头ctrl + ]
:跳到代码结尾ctrl + /
: 注释(选中多行后批量注释/取消注释)tab
: 缩进当前行(选中多行后批量缩进)shift + tab
: 取消缩进(选中后可以批量取消缩进)ctrl + f
:查找(全局加shift)ctrl + r
:替换(全局加shift)shift + F10
:运行shift + F9
:调试F8
: 单步调试(一行一行走,我的笔记本无效)Ctrl + F8
: 在当前行加上断点/断点开关Ctrl + N
: 快速查找文件
自定义快捷键:file——>setting——>Keymap
Ref: https://www.jianshu.com/p/883f8343c7dbhttps://blog.csdn.net/TyuansushiT/article/details/81836732
https://blog.csdn.net/qq_40130759/article/details/79421242
https://www.cnblogs.com/sui776265233/p/10200809.html