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

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM