初次安装使用PyCharm,在新建.py文件时会发现文件头并没有什么信息,因此,使用模板会比较方便。
方法如下:
1.打开PyCharm,选择File--Settings
2.依次选择Editor---Code Style-- File and Code Templates---Python Script
3.编辑内容
可以根据需要添加相应的信息

#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
ScriptName: ${NAME}
Project: ${PROJECT_NAME}
Author: MeiMeiLong.
Create Date: ${YEAR}-${MONTH}-${DAY} ${HOUR}:${MINUTE}:${SECOND}
Description:
"""
__author__ = 'longlong'</code>
#!/usr/bin/env bash
#ScriptName: ${NAME}
#Project: ${PROJECT_NAME}
#Author: MeiMeiLong.
#Create Date: ${YEAR}-${MONTH}-${DAY} ${HOUR}:${MINUTE}:${SECOND}
#Description:

可用的预定义文件模板变量为:

###Chinese Ver.
$ {PROJECT_NAME} - 当前项目的名称。
$ {NAME} - 在文件创建过程中在“新建文件”对话框中指定的新文件的名称。
$ {USER} - 当前用户的登录名。
$ {DATE} - 当前的系统日期。
$ {TIME} - 当前系统时间。
$ {YEAR} - 今年。
$ {MONTH} - 当月。
$ {DAY} - 当月的当天。
$ {HOUR} - 目前的小时。
$ {MINUTE} - 当前分钟。
$ {PRODUCT_NAME} - 将在其中创建文件的IDE的名称。
$ {MONTH_NAME_SHORT} - 月份名称的前3个字母。 示例:1月,2月等
$ {MONTH_NAME_FULL} - 一个月的全名。 示例:1月,2月等
###English Ver.
${PROJECT_NAME} - the name of the current project.
${NAME} - the name of the new file which you specify in the New File dialog box during the file creation.
${USER} - the login name of the current user.
${DATE} - the current system date.
${TIME} - the current system time.
${YEAR} - the current year.
${MONTH} - the current month.
${DAY} - the current day of the month.
${HOUR} - the current hour.
${MINUTE} - the current minute.
${PRODUCT_NAME} - the name of the IDE in which the file will be created.
${MONTH_NAME_SHORT} - the first 3 letters of the month name. Example: Jan, Feb, etc.
${MONTH_NAME_FULL} - full name of a month.

IDEA PYCHARM USAGE NOTE的更多相关文章

  1. dfsdf

    This project was bootstrapped with Create React App. Below you will find some information on how to ...

  2. 使用create react app教程

    This project was bootstrapped with Create React App. Below you will find some information on how to ...

  3. 非常全面的SQL Server巡检脚本来自sqlskills团队的Glenn Berry 大牛

    非常全面的SQL Server巡检脚本来自sqlskills团队的Glenn Berry 大牛 Glenn Berry 大牛会对这个脚本持续更新 -- SQL Server 2012 Diagnost ...

  4. ASP.NET MVC异步上传文件

    自己做的一个小dome.贴出来分享一下: 前端: <form id="formfile" method="post" enctype="mult ...

  5. Groovy 模版引擎

    1. Introduction Groovy supports multiple ways to generate text dynamically including GStrings, print ...

  6. Ajax.BeginForm 上传文件

    在 Mvc 中上传文件时通常使用 Html.BeginForm 标签,同时对Form 添加属性 enctype = "multipart/form-data",前端代码如下: @H ...

  7. Enumerable.SequenceEqual

    Determines whether two sequences are equal by comparing the elements by using the default equality c ...

  8. class JOIN

    class JOIN :public Sql_alloc { JOIN(const JOIN &rhs); /**< not implemented */ JOIN& opera ...

  9. Semaphore 和 Mutex

    mutex和semaphore有什么区别呢? mutex是用作互斥的,而semaphore是用作同步的. 也就是说,mutex的初始化一定是为1,而semaphore可以是任意的数, 所以如果使用mu ...

随机推荐

  1. 有用的git命令

    1. git log -p // 查看log的详细信息 2. git reset HEAD xxxx // 将文件从stage状态拉出来 3. git checkout -- xxxx // 将修改的 ...

  2. mac中 hosts地址

    /etc/hosts 拉出hosts文件,修改之后再拉进去

  3. 『流畅的Python』第9章笔记_对象

    一.Python风格 以一个二元素向量对象为例 import math from array import array class Vector2d: typecode = 'd' def __ini ...

  4. Codeforces Beta Round #64D - Professor's task

    题意:两种操作1.加点2.查询点是否在之前给定点的凸包内 题解:set维护动态凸包,分别维护上下凸壳,对y取反就行,判断点是否在凸壳内,把点加进去看要不要删除就好了 //#pragma GCC opt ...

  5. hdu-5889-最短路+网络流/最小割

    Barricade Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total S ...

  6. 由于 Exception.tostring()失败,因此无法打印异常字符串

    console程序执行错误时,不显示异常信息. 解决方法: 在命令行修改显示字符格式  chcp 936

  7. spring boot cloud

    eclipse spring boot 项目创建 https://www.cnblogs.com/shuaihan/p/8027082.html https://www.cnblogs.com/LUA ...

  8. 在用mybatis向MySQL数据库中插入时间时报错:Incorrect datetime value: '' for column '' at row 1

    问题说明:使用的MySQL是5.1.37版本,用的mysql-connector-java-5.0.4.jar版本,在java文件中定义的字段是Date类型,MySQL中定义的字段类型是datetim ...

  9. linux nginx 添加到全局变量中(环境变量)

    ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/ /usr/local/bin/就是环境变量目录

  10. 【SQL】group by 及 having

    Group By 分组汇总 HAVING:给分组设置条件 1.概述 “Group By”从字面意义上理解就是根据“By”指定的规则对数据进行分组,所谓的分组就是将一个“数据集”划分成若干个“小区域”, ...