"python.formatting.provider": "yapf"

然后Alt+Shift+F就可以自动格式化代码