Python configuration operations and Applications

Source: Internet
Author: User

Do you want to know the actual operations and related code of Python configuration? If you are interested in the practical application solutions related to Python configuration, you can understand it through the following articles. The following is what you will gain when you forget about gymnastics in this article.

Vim's default configuration has limited support for Python. you can install plug-ins and other methods to improve the efficiency of writing Python programs in Vim.

 
 
  1. < typetype="text/javascript">  

Set indent in ~ /. Add the following settings to vimrc: "automatically detect the file type and load the corresponding settings.

 
 
  1. filetype plugin indent on 

We recommend that you use spaces instead of tabs in the Python configuration file. In addition, the indentation should be four spaces. Therefore, you can add the following again:

 
 
  1. autocmd FileType python setlocal et sta sw=4 sts=4 

Tip:

For more information about the preceding settings, see Vim code indent settings.

Better syntax highlighting

The default Python syntax highlighting function is limited, for example, the number is not highlighted.

Comment management

The vim plug-in EnhCommentify or comments provides the Comment management function. For details, see vim and program annotations.

Enhanced Code Completion prompt

Vim's code auto-completion function Ctrl-N) is very useful, see VI (VIM) programming skills ). By default, Vim can only recognize the variable names in the current file, which makes Code Completion meaningless for Python library functions. [1] pydiction has changed this situation. Python configuration can help to automatically complete Python library functions.


 

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.