Python uses installation ipdb

Source: Internet
Author: User

1. Installation

Python3 version directly performs pip install ipdb command installation

python2.7 version needs to specify the version of IPDB

Pip Install ipdb==0.10.2

After the equals sign is the version, because the PIP install ipdb is the latest version installed by default, now the IPDB needs Python3 support

So python2.7 installation can only specify older version installation

Use of ipdb

2. Use

Python-m ipdb xxx.py

Inside the program:

From ipdb import Set_trace

Set_trace ()

3. Common commands

    • ENTER(Repeat Last command)
    • cContinue to
    • l(Find where it is currently located)
    • s(Go to subroutine)
    • r(run until subroutine ends)
    • !<python 命令>
    • hHelp
    • A (RGS) prints the parameters of the current function
    • J (UMP) lets the program jump to the specified number of rows
    • L (IST) can list code blocks that are currently going to run
    • N (EXT) lets the program run the next line, if the current statement has a function call, n is not entered in the called function body
    • P (rint) One of the most useful commands to print a variable
    • Q (uit) exit debug
    • R (Eturn) continues execution until the function body returns
    • S (TEP) is similar to n, but if there is currently a function call, then s will enter the body of the called function

Python uses installation ipdb

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.