1/5
## Python Tip: breakpoint() We're going to run our code one more time, but we are going to use a Python debugging technique called breakpoints. Let's add the following line of code to our Python script: ```python breakpoint() ``` Now, when we run our code, it will execute all of the lines up until the line where we've added `breakpoint()`. It will then drop us into a Python shell. This Python shell, also known as a PDB (Python Debugger) allows us to interactively execute code. To demonstrate this, let's run our code again, after deactivating our virtual environment: ```bash uv run python deploy_favorites.py ``` After the code executes, we'll be dropped into a Python shell. Let's execute the following command: ```python favorites_contract ``` This will output the result of `favorites_contract`, which is a placeholder for the bytecode. We can type `quit` to exit the Python debugger or `q` depending on the debugger, as well. We can then remove the `breakpoint()` line and continue coding.
A powerful Python tip to learn breakpoint() - Learn how to use the breakpoint() function to pause Python code execution and enter a debug shell to inspect variables, execute code, and troubleshoot problems.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Python basics
Introduction to Web3.py
Introduction to Titanoboa
Introduction to Moccasin
How to create an ERC-20
How to test Python code and Vyper smart contract
How to deploy Vyper smart contracts on ZKsync using Moccasin
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on April 21, 2025
Duration: 2h 20min
Duration: 1h 51min
Duration: 58min
Duration: 2h 23min
Duration: 53min
Duration: 2h 24min
Duration: 28min
Duration: 1h 54min
Duration: 11min
Course Overview
About the course
Python basics
Introduction to Web3.py
Introduction to Titanoboa
Introduction to Moccasin
How to create an ERC-20
How to test Python code and Vyper smart contract
How to deploy Vyper smart contracts on ZKsync using Moccasin
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
On-chain Data Analyst
$59,000 - $139,000 (avg. salary)
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Last updated on April 21, 2025
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar