main

设置 - 用户代码片段 - python

  1. {
  2. // Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and
  3. // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
  4. // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
  5. // same ids are connected.
  6. // Example:
  7. // "Print to console": {
  8. // "prefix": "log",
  9. // "body": [
  10. // "console.log('$1');",
  11. // "$2"
  12. // ],
  13. // "description": "Log output to console"
  14. // }
  15. "Print to console": {
  16. "prefix": "main()",
  17. "body": [
  18. "if __name__ == __main__:",
  19. "",
  20. ],
  21. "description": "python--main"
  22. }
  23. }

参考

https://stackoverflow.com/questions/29995863/how-to-add-custom-code-snippets-in-vscode