1、进入vscode选择文件,首选项下的用户代码片段
2、弹出框输入Python后回车
3、弹出文件(python.json)输入如下内容,原有内容不要修改或者删除,加入funciton部分
"HEADER":{"prefix": "header", "body": [ "#!/usr/bin/env python", "# -*- coding: utf-8 -*-", "'''", "@File : $TM_FILENAME", "@Time : $CURRENT_YEAR/$CURRENT_MONTH/$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND", "@Author : CrissChan ", "@Version : 1.0", "@Site : https://blog.csdn.net/crisschan", "@Desc : None", "'''", "", "$0" ], }, "function": { "prefix": "function", "body": [ "'''", "@des :", " ", "@params :", " ", "@return :", " ", "'''", "", "$0" ], },