Idea Pycharm Usage Note

初次安装使用PyCharm,在新建.py文件时会发现文件头并没有什么信息,因此,使用模板会比较方便。
方法如下:
1.打开PyCharm,选择File--Settings
2.依次选择Editor---Code Style-- File and Code Templates---Python Script
3.编辑内容
可以根据需要添加相应的信息     
 
Python:
#!/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'
Shell:
#!/usr/bin/env bash
#ScriptName: ${NAME}
#Project: ${PROJECT_NAME}
#Author: MeiMeiLong.
#Create Date: ${YEAR}-${MONTH}-${DAY} ${HOUR}:${MINUTE}:${SECOND}
#Description: 

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

$ {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月等

${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. Example: January, February, etc.
 
神秘网站

猜你喜欢

转载自www.cnblogs.com/meilong/p/10352522.html