如何在 vs 代码中为“main”函数编写代码片段?它不允许在 body 之间放置双“”。这是我写的:
"Print to console": {
"prefix": "mai",
"body": [
"if __name__ == __main__:"
],
"description": "This throws main"
我想要这个:
if __name__ == '__main__':
pass
如何制作这个片段?
最佳答案
试试这个。
"Print to console": {
"prefix": "mai",
"body": [
"if __name__ == '__main__':",
"\tpass"
],
"description": "Whatever you want to write."
}
关于python - 关于在 vs 代码中为 python 添加一个片段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72145054/