欢迎来到starnight_cyber的博客

PyCharm 设置作者注释及脚本模板

  本篇简要介绍下如何使用 PyCharm 设置默认的作者信息和脚本模板。

  PyCharm >> Preferences/Settings >> Editor >> File and Code Templates >> Python Script >> 设置内容 >> 点击 Apply。

 

  可自定义作者信息和脚本模板,后续创建新的 python 脚本时,会自动生成如下脚本内容。

  可以把一些自己常用的基础代码设置成模板。

 

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : ${DATE}
# @Author  : starnight_cyber
# @Github  : https://github.com/starnightcyber
# @Software: ${PRODUCT_NAME}
# @File    : ${NAME}.py

import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import ssl
import time

# Do not support ssl and disable warning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
ssl._create_default_https_context = ssl._create_unverified_context
timestamp = time.strftime("%Y-%m-%d", time.localtime(time.time()))

def test():
    # write your code here
    pass


if __name__ == '__main__':
    test()
    pass

 

Refer ~ 

https://blog.csdn.net/u010105243/article/details/76154251

  

posted @ 2022-02-11 12:02  starnight_cyber  阅读(1710)  评论(0编辑  收藏  举报