Vscode-python Advanced Configuration

Source: Internet
Author: User
Tags python script

Vscode-python Advanced Configuration Chinese garbled

Chinese garbled, online a bunch of solutions, but there is no effective effect.
Before the Python script, add:

# -*- coding:utf-8 -*-

The print output is not garbled when the console output is not true. But at this point the output of Os.system () is normal,
If you use debugging to output the opposite result: the print output is normal, but the terminal output is garbled.

Workaround: Try not to use Chinese
All right, no eggs! Please advise any small partner who has a solution.

Automatically add text first notes

You need to install Vscode-fileheader at this time
Configuration is required after installation:
Files--Preferences--settings
Open Setting.json, search for Fileheader, and locate the following settings:

  // By default, create file  username  "fileheader.Author": "mikey.zhaopeng",  // By default, common template. Do not modify it!!!!!  "fileheader.tpl": "/*\r\n * @Author: {author} \r\n * @Date: {createTime} \r\n * @Last Modified by:   {lastModifiedBy} \r\n * @Last Modified time: {updateTime} \r\n */\r\n",  // By default, update file  username.  "fileheader.LastModifiedBy": "mikey.zhaopeng",

Then make your changes:

    // By default, create file  username 此处更改为你的用户名    "fileheader.Author": "Yanta",     // By default, common template. Do not modify it!!!!!      "fileheader.tpl": "#!/usr/bin/env python \r\n# -*- coding:utf-8 -*- \r\n‘‘‘\r\n * @Author: {author} \r\n * @Date: {createTime} \r\n * @Last Modified by:   {lastModifiedBy} \r\n * @Last Modified time: {updateTime} \r\n * @Desc: \r\n‘‘‘\r\n",      // By default, update file  username. 此处更改为你的用户名    "fileheader.LastModifiedBy": "Yanta",    "workbench.iconTheme": "vscode-icons"

You will need to restart Vscode after you have changed the above configuration, otherwise the changes will not be applied.
After restarting the new file, press the shortcut key: Ctrl+alt+i, will automatically fill in the beginning of the script comment content.

Insufficient

File-header currently unable to automatically add the comment section, and can not like Vim automatically recognize the script type, and then automatically insert the corresponding text first note.
Annotations can only be treated equally for all script files.

File icon

Add the file icon plugin, in fact, just to look good.
Direct search: Vscode-icons installation.

Vscode-python Advanced Configuration

Related Article

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.