vscode python代码格式化设置

标题

安装 Black Formatter 插件

打开settings json 文件:

{
    "python.formatting.provider": "none",
    "python.formatting.autopep8Args": [
        "--max-line-length=150"
    ],
    "editor.wordWrap": "on",
    "editor.wordWrapColumn": 150,
    "[python]": {
        "editor.defaultFormatter": "ms-python.black-formatter",
        "editor.formatOnSave": true,
        "editor.formatOnPaste": true,
        "editor.formatOnType": true,
    },
    "black-formatter.args": [
        "--line-length",
        "150"
    ],
}

你可能感兴趣的:(vscode,python,ide)