python -m pdb hello.py
This will give us an interface we can use to debug our script.
https://docs.python.org/2/library/pdb.html#debugger-commands
#!/usr/bin/python | |
# import modules used here -- sys is a very standard one | |
import sys | |
# Gather our code in a main() function | |
def main(): | |
print 'Hello there', sys.argv[1] if len(sys.argv) > 1 else 'Anon' | |
# Command line args are in sys.argv[1], sys.argv[2] .. | |
# sys.argv[0] is the script name itself and can be ignored | |
# Standard boilerplate to call the main() function to begin | |
# the program. | |
if __name__ == '__main__': | |
main() |
python -m pdb hello.py
This will give us an interface we can use to debug our script.
https://docs.python.org/2/library/pdb.html#debugger-commands