Stepping through Python with the Spyder compiler

Source: Internet
Author: User

1. A function that requires one-step debugging is called in the script (a very important step). Since Python is an interpreted language, you need to tell the system that you are using this function when you are doing one-step debugging, and stepping into the function that you need. As shown, we define the CreateDataSet () function, which is called in the script before debugging, which is the red marked part.

2. Add Breakpoints. As with the rest of the programming languages, add breakpoints to the statement you want to see the results in, and add the aspect of double-clicking before the statement or clicking the F12 button when the statement is selected. The effect is as shown.

3, according to the different needs of programmers to debug. The Spyder provides an adjustable panel,

The first button is to debug the button, click or press CTRL+F5 to enter the mode, the program reaches the first breakpoint you set, this step is necessary for the mode, the second is a single-step button, click or press CTRL+F10 to set the breakpoint after the single-step The third button can enter the inside of the function body contained in the sentence where the cursor is located, or press the shortcut key ctrl+f11; the fourth one jumps from this function, the fifth one jumps to the next breakpoint, and the last button stops debugging.

After clicking to debug, you can see the variable information in the location shown.

Stepping through Python with the Spyder compiler

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.