• vscode添加python文件头模板(Mac版)


    1.打开vscode,Preference-User Snippets, 搜索Python.json文件

    2.修改python.json配置文件

    {
    	// Place your snippets for python here. Each snippet is defined under a snippet name and has a prefix, body and 
    	// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
    	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
    	// same ids are connected.
    	// Example:
    	// "Print to console": {
    	// 	"prefix": "log",
    	// 	"body": [
    	// 		"console.log('$1');",
    	// 		"$2"
    	// 	],
    	// 	"description": "Log output to console"
    	// }
    	"HEADER":{
    		"prefix": "header",
    		"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  :   软件质量保障",
    		"@Email   :   xxxxx@163.com",
    		"@Blog    :   https://www.zhihu.com/people/iloverain1024",
    		"@Copyright : 侵权必究",
    				
    		"'''",
    		"",
    		"# here put the import lib",
    		"$0"
    		],
    	}
    }

    3.使用头文件

     

  • 相关阅读:
    洛谷 P1089.津津的储蓄计划
    AcWing 786.第k个数
    差分
    AcWing 798.差分矩阵
    AcWing 797.差分
    AcWing 796.子矩阵的和
    Python 初始—(项目 目录结构)
    Python 初始—(迭代器和生成器)
    Python 初始—(装饰器)
    Python 初始—(高阶函数)
  • 原文地址:https://www.cnblogs.com/iloverain/p/16515139.html
Copyright © 2020-2023  润新知