PyCharm 设置小计
文章目录
在使用Python 3.6的新特性f-strings时,出现如下warning,身为完美主义+强迫症患者,怎么能忍?
Python version 2.7 does not support a 'F' prefix less...(Ctrl+F1)
展开详情:
Enable this inspection if you need your code to be compatiable with a range of Python versions(for example, if you're building a library). The range to of Python versions with which the code needs to be compatible can be specified in the inspection settings.
无脑Google翻译一下:
如果您需要你的代码兼容多个Python版本(例如:如果您正在构建一个库),请启用此检查。 检查设置中可以指定你的代码需要兼容的Python版本的范围。
在Settings 中搜索 compatible 这个词,果然发现
Settings>Editor>Inspections
下有针对各语言的以一些检查设置,找到Python下的设置:Code compatibility inspection,默认勾选了2.7版本,取消勾选,让 Python 2 滚粗,让我们愉快的用Python 3 的新特性!(^o^)/~
快捷键
| 快捷键 | 说明 |
|---|---|
Ctrl+Alt+O
|
排序导入模块,并移除未使用模块 |
Ctrl+Alt+L
|
格式化代码 |
Ctrl+Y
|
删除行 |
Shift+Alt+↑/↓
|
当前行上移或下移一行 |
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论