How do you edit the default `__author__ = name` li

2020-08-22 06:40发布

In pycharm, when making a new "Python File" it has some content by default: __author__ = 'david'.

What I want to do, is changing this default content by the following shebang:

#!/usr/bin/env python
#-*- coding: utf-8 -*-

This way, when opening new python files on pycharm, this content above will already be there. How to do this?

2条回答
淡お忘
2楼-- · 2020-08-22 06:48

In PyCharm, go to Preferences > IDE Settings > File and Code Templates and then click on the Python Script template and change it from the default to whatever you want.

Thanks for the question, I always thought the __author__ = blah was annoying but never took the time to learn how to fix it.

查看更多
够拽才男人
3楼-- · 2020-08-22 07:03

The menu path is now File > Settings > Editor > File and Code Templates. You might need to change it on multiple templates depending upon how many of your Python templates have this at the top.

查看更多
登录 后发表回答