vscode 不会像pycharm可以代码自动联想出 if __name__ == '__main__': 操作点击左下角齿轮按钮 ——用户代码片段
然后输入python搜索出现 python.json
然后将一下代码输入后重启就可以了
代码如下:
"Print to console": {
"prefix": "main",
"body": [
"if __name__ == '__main__':",
" ${1:pass}",
"",
],
"description": "python--main"
}
标签:__,name,vscode,代码,python,main From: https://www.cnblogs.com/justsoso8/p/17739793.html