isort https://pycqa.github.io/isort/
isort · PyPI https://pypi.org/project/isort/
Before isort:
from my_lib import Object
import os
from my_lib import Object3
from my_lib import Object2
import sys
from third_party import lib15, lib1, lib2, lib3, lib4, lib5, lib6, lib7, lib8, lib9, lib10, lib11, lib12, lib13, lib14
import sys
from __future__ import absolute_import
from third_party import lib3
print("Hey")
print("yo")
After isort:
from __future__ import absolute_import
import os
import sys
from third_party import (lib1, lib2, lib3, lib4, lib5, lib6, lib7, lib8,
lib9, lib10, lib11, lib12, lib13, lib14, lib15)
from my_lib import Object, Object2, Object3
print("Hey")
print("yo")
Commit | PyCharm Documentation https://www.jetbrains.com/help/pycharm/commit-dialog.html
Before Commit |
|
Reformat code |
Perform code formatting according to the Project Code Style settings. |
Rearrange code |
Rearrange your code according to the arrangement rules preferences. |
Optimize imports |
Remove redundant import statements. |
翻译
搜索
复制
标签:__,code,lib,python,print,顺序,isort,引入,import From: https://www.cnblogs.com/papering/p/18386317