JetBrains全家桶
全家桶编辑器,支持多个语言
2. Pycharm
Section titled “2. Pycharm”2.1. 自定义注释
Section titled “2.1. 自定义注释”2.1.1. 文件注释
Section titled “2.1.1. 文件注释”# settings -> Editor -> File and Code Templates -> Python Script
# -*- encoding: utf-8 -*-'''@File : test.py@Contact : nickyang80042@gmail.com@License : (C)Copyright 2018-2025@Desciption : None
@Modify Time @Author @Version @Desciption------------ ------- -------- -----------2024/11/13 19:07 nickyang 1.0 None'''2.1.2. 函数注释
Section titled “2.1.2. 函数注释”# settings -> Tools -> Python Intergrated Tools -> Docsstrings -> 选项设置为 reStructuedText # 添加函数注释# settings -> Editor - General - Smart Keys - Python 开启 Insert type placeholders in the documentation comment stub # 添加类型注释2.1.3. 自定义模板
Section titled “2.1.3. 自定义模板”# File -> Settings -> Editor -> Live Templates -> Python# 新增 -> Abbreviation(激活键) -> Description(描述信息) -> Template text(模板,可以包含标量 $Time$) -> Edit Variables(定义变量) -> Aplicable(配置适用文件)2.1.4. 拓展工具
Section titled “2.1.4. 拓展工具”pip install black #代码格式化pip install isort #导包排序# Preference > Tools > External Tools。# Arguments: $FilePath$# Working directory: $ProjectFileDir$2.1.5. 保存自动运行脚本
Section titled “2.1.5. 保存自动运行脚本”# Preference > Tools > File Watchers# Arguments: $FilePath$# Output Path: $FilePath$# Working directory: $ProjectFileDir$2.1.6. 设置自动保存时间
Section titled “2.1.6. 设置自动保存时间”Preference > Appearance & Behavior > System Settings3. 拓展信息
Section titled “3. 拓展信息”…
4. 参考资料
Section titled “4. 参考资料”…