VSCode配置:为Python文件添加头部信息
2022-08-20 本文已影响0人
blair_liu
VScode配置方法
依次点击File-Preferences-configuresUser Snippets,选择Python
在弹出的python.json文件中加入以下自定义代码段,保存退出
"MYHEADER":{
"prefix": "myheader",
"body": [
// "#!/usr/bin/env python",
"# -*- encoding: utf-8 -*-",
"'''",
"@File : $TM_FILENAME",
"@Time : $CURRENT_YEAR/$CURRENT_MONTH/$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE:$CURRENT_SECOND",
"@Author : yourname",
"@Version : 1.0",
"@Contact : yourmail",
"@Desc : None",
"'''",
"",
"# here put the import lib",
"",
"",
],
}
保存
在代码敲入myheader自动生成