Automatically add a few lines of common code to your head when you create a new sublime Python code file

Source: Internet
Author: User


1th Step:

Install Fileheader, and then

Preferences->packages settings->file header->settings User

Fileheader.sublime-settings read as follows:

{
"Default":
{
"Author": "Chi Yu",
"Email": "Chkvta9523@163.com"
}


}

2nd Step:

Preferences->browse Packages

C:\Users\appleyuchi\AppData\Roaming\Sublime Text 3\packages\fileheader\template\header

Modify Python.tmpl as follows:

#-*-Coding:utf-8-*-
Import Sys
Reload (SYS)
Sys.setdefaultencoding (' Utf-8 ')
# @Author: {{Author}}}
# @Date: {{create_time}}}
# @Last Modified by: {last_modified_by}}
# @Last Modified time: {{last_modified_time}}}


3rd step, the above effect will not take effect when the new. py file is saved, it will automatically add the above 8 lines of text in the header, it is convenient

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.