python - PyCharm 专业版中的自动格式化导入
问题描述
我最近偶然发现IntelliJ PyCharm PE开始自动优化我的导入的问题,但我从未启用/安装过此类功能,但是我确实安装了isort ,但我不记得它有自动优化选项。有谁知道如何解决这个问题?
示例:我正在查看代码:
from here import this
from here2 import this2
from here1 import this1
当我通过 ( Alt+0 ) PyCharm 的提交接口进行提交阶段时,它会将这些导入自动格式化为:
from here import this
from here1 import this1
from here2 import this2
解决方案
因此,事实证明 Pycharm 在通过位于设置/工具部分下的文件观察器功能保存/提交更改时自动格式化我的导入,禁用它有助于自动格式化。
推荐阅读
- python - 如何在Python中使用正则表达式提取关键字后的数字?
- c# - 如何解释“at mynamespace.MyClass+BA ()”形式的堆栈跟踪
- java - 如何解决“XML 外部实体引用 ('XXE') 的不当限制”
- jolt - 支持输入 json 的 JOLT 规范
- bluetooth-lowenergy - 连接后继续做广告 bluez
- c# - 有没有办法从 C# 插件调用 PowerPoint 的 DoEvents() 函数?
- react-native - 如何在反应原生地图中单击按钮时一起显示多个位置工具提示
- mysql - 显示昵称而不是表的 ID 号
- plotly-dash - 如何从通过 Plotly Dash dcc 上传选项上传的数据动态填充 DropDown
- ios - 即使滚动到最后,如何让 ScrollView 消耗触摸事件?