Home >Backend Development >Python Tutorial >How to choose an editor for Python code

How to choose an editor for Python code

巴扎黑
巴扎黑Original
2017-09-15 10:52:441802browse

The following editor will bring you an article on the selection of a Python code editor (detailed explanation). The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor and take a look.

The Python development environment is configured, but we find that the built-in code editor seems a bit uncomfortable to use, so we look for a “easy-to-use” code editor. I searched the Internet for information. The commonly used editors for Python are as follows:

1. Sublime Text
2. Vim
3. PyScripter
4. PyCharm
5 . Eclipse with PyDev
6. Emacs
7. Komodo Edit
8. Wing
9. The Eric Python IDE
10. Interactive Editor for Python
11. ulipad
12. Geany
13. IDLE
14. PythonWin
15. SPE
……

During the development process, most people who choose an editor hope to have the following functions: Grammar Highlighting, syntax checking, code auto-completion, intelligent perception of variable/function names, convenient debugging, code folding, good Chinese support, etc. From the Internet information, it seems that Vim is recommended most by seniors, and as a novice, I just Silently search for the download address of Vim: http://www.vim.org/download.php Now it is a windows system, find PC: MS-DOS and MS-Windows, download the Vim installation file, and then install it. After the installation is complete, now configure Vim as a Python IDE, modify Vim's configuration file _vimrc, open it in text mode, and add the following setting command at the end:

syntax enable
set colorscheme murphy
set guifont=Consolas:h12
set tabstop=4
set nu
set ai
set si
set guioptions-=T
set nobackup
nmap :w!:!python %
cd C:\Users\MyTest\AppData\Local\Programs\Python\Python36

##The specific instructions are as follows :

syntax enable Keyword highlighting

set colorscheme murphy Change background color
set guifont=Consolas:h12 Set font
set tabstop=4 One tab key is equivalent Use 4 space keys
set nu to display line numbers
set ai for automatic indentation
set si for smart indentation
set guioptions-=T to hide the toolbar
set nobackup to not generate a backup file
nmap :w!:!python % Set the shortcut key for running
cd C:\Users\MyTest\AppData\Local\Programs\Python\Python36 Set up Python installation There are many commands set in the path

, so I won’t introduce them one by one here. You can search them online or read the documents. Some of what I know here are also collected from the Internet. After configuring it, find a piece of code and try it, as shown in the picture:

The functions of the Vim editor are very powerful. You must study it more. As a novice, I am actually very unaccustomed to using it. Especially when configuring code completion and installing the

YouCompleteMe plug-in, it is even more frustrating. The downloaded version cannot be compiled, and it is considered to have given up from compiling. So I re-downloaded PyCharm, found the code and ran the following effect:

It feels pretty good! It is recommended that entry-level players use PyCharm, haha! Let’s start the journey of learning Python~

The above is the detailed content of How to choose an editor for Python code. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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