How to add default information to Pycharm template? How to add default information

青灯夜游
Release: 2018-10-27 17:51:49
forward
3115 people have browsed it

The content of this article is to introduce how to add default information to Pycharm template? How to add default information. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

We use the python3. The text is commented out, why does it still report an error when using it??

The error is reported because we are using the python2 interpreter. The python2 interpreter does not recognize Chinese. The Chinese we wrote is commented out. But it is still Take a simple look. It will be unhappy if it finds something it doesn’t recognize

. In order to solve this problem, we need to add a sentence

# -*- coding: utf-8 -*-
Copy after login

to the head of the file to solve this problem. .But if we frequently use the python2 version, we need to write it every time. There is a way to solve this problem below. Let’s take a look at the renderings first:

Okay Okay, let’s practice quickly:

The first step is to find the file file and click

The second step is to find settings and click to enter

The third step is to find the Editor and click

Then you will find that it is empty, you only need to copy the content into it That’s it

##!/usr/bin/python3
'''
-*- coding: utf-8 -*-
@Author  : Meet
@Time    : ${DATE} ${TIME}
@Software: ${PRODUCT_NAME}
@File    : ${NAME}.py
'''
Copy after login

Then click Apply and click OK. When you click OK, the window will be closed. Now go and create a file and try it!

The above is the detailed content of How to add default information to Pycharm template? How to add default information. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template