Source From Here
Question
My code is, for better or worse, rife with single letter variables (it's physics stuff, so those letters are meaningful), as well as NumPy's, which I'm often interacting with. When using the Python debugger, occasionally I'll want to look at the value of, say, n. However, when I hit n , that's the PDB command for(n)ext, which has a higher priority. print n works around looking at it, but how can I set it?
How-To
Use an exclamation mark ! before a statement to have it run. Consider we have a test.py
- test.py
Run it this way:
Question
My code is, for better or worse, rife with single letter variables (it's physics stuff, so those letters are meaningful), as well as NumPy's, which I'm often interacting with. When using the Python debugger, occasionally I'll want to look at the value of, say, n. However, when I hit n
How-To
Use an exclamation mark ! before a statement to have it run. Consider we have a test.py
- test.py
- #!/usr/bin/env python
- print("foo")
- print("bar")
沒有留言:
張貼留言