解决Vscode 无 if __name__ == '__main__':
自动提示问题
配置步骤:
设置------》用户代码片段------》python.json配置文件------》添加"Print to console"项
添加代码内容:
*
"Print to console": {
"prefix": "main",
"body": [
"if __name__ == '__main__':",
" ${1:pass}",
"",
],
"description": "python--main"
}
步骤图例: