How to Make python debugging easier under vim?

Source: Internet
Author: User
0 reply content: add this configuration to The. vimrc file and press F5 to run the current. py file, supplemented by unittest.
Au BufRead *. py map : W :! /Usr/bin/env python % Open vi and enter:

:!wget https://download.jetbrains.com/python/pycharm-community-5.0.2.tar.gz:!tar xvfz pycharm-community-5.0.2.tar.gz:!pycharm-community-5.0.2/bin/pycharm.sh
Follow these steps: Turning Vim into a modern python IDE
Http://sontek.net/turning-vim-into-a-modern-python-ide

My configured graph:
Ipython
I have always said that I would like to present the previous translated version: Using Vim to create a modern Python IDE-feisky (Shanda cloud-software development) Configure by following these steps.
Http://sontek.net/blog/detail/turning-vim-into-a-modern-python-ide: Pycharm is used to open a terminal for vim editing, and the command line of the other terminal is used to run the edited file.
Refer to the reply from the birds of prey and ask for folding-learn to use ipdb + ipython
-Tools that can detect file changes and execute them again in real time, such as the supervisor
-The method mentioned by the Raptors should be divided into two parts: Development and debugging.

You can refer to the following two articles for development:
Http://www.mikeshi.me/wordpress? P = 281
Http://www.mikeshi.me/wordpress? P = 286
It is mainly to install some plug-ins to make development more convenient. I personally installed some file management plug-ins (to facilitate project management), and the others are rarely used.

In the debugging part, I personally seldom use the step by step debugging method. Most of the time, I used the observation error message + print method for debugging. Thanks to the unified exception output of python, this method is more handy in python, and error locating and analysis of error causes are generally faster.

Using unittest during development is a good habit, which can greatly reduce logical errors. Python comes with the unittest framework. Also recommended nose (http://readthedocs.org/docs/nose/en/latest/ ) To make unittest more convenient. Use jedi, then use ipdb, and then use ipython. It is best to develop with test-driven development.

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.