How to write a file code template in Pycharm
To add utf-8 compatibility in all your scripts, one solution is enable a template that add this compatibility and other information as copyright, your name, etc.
File and code templates are written in the Velocity Template Language (VTL). So you may include variables as ${YEAR}, ${USER}, etc.
To add code to your scritps go to File/Settings.../Editor/File and Code Templates
Select Python Script and add the following lines:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (C) ${YEAR} ${USER}
Now, if you create a new Python file, it will generate with this header code by default.
If you want more VTL variables please go here
Enjoy it!
File and code templates are written in the Velocity Template Language (VTL). So you may include variables as ${YEAR}, ${USER}, etc.
To add code to your scritps go to File/Settings.../Editor/File and Code Templates
Select Python Script and add the following lines:
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Copyright (C) ${YEAR} ${USER}
Now, if you create a new Python file, it will generate with this header code by default.
If you want more VTL variables please go here
Enjoy it!
Comments
Post a Comment