VScode中使用Black Formatter调整Python代码排版格式
·
1.插件下载
在vscode中打开Extensions(快捷键是Ctrl+Shift+X),在其中搜索Black Formatter,完成安装。

2.插件设置
shift+ctrl+p打开用户设置setting.json,在最后加入:
"editor.defaultFormatter": "ms-python.black-formatter",
"black-formatter.args": [
"--skip-string-normalization"
],
"editor.formatOnSave": true
设置完成后,在vscode中保存文件(快捷键为Ctrl+S)时,会自动调整python代码的格式。
更多推荐



所有评论(0)