Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

In which video there is the example of excecuting python with the `-t` flag to run the script but keep the REPL?

I remember watching this video but can't remember which one it was

EDIT: It was -i flag for interactive

2 Answers

Jeff Muday
MOD
Jeff Muday
Treehouse Moderator 28,720 Points

Rodrigo,

I can't remember where I saw that-- I recall it had something to do with debugging code. The closest video I can find is of Kenneth Love showing off the python debugger in the course "Write Better Python"

https://teamtreehouse.com/library/the-python-debugger

Important Too

Here is something else worth looking into...

https://docs.python.org/3/library/pdb.html

The Python -m flag

pdb.py can also be invoked as a script to debug other scripts. For example:

$ python3 -m pdb myscript.py

When invoked as a script, pdb will automatically enter post-mortem debugging
if the program being debugged exits abnormally. After post-mortem debugging
(or after normal exit of the program), pdb will restart the program. Automatic
restarting preserves pdb’s state (such as breakpoints) and in most cases is more
useful than quitting the debugger upon program’s exit.

cheers,

Jeff

Thank you! That's right. Can you recall the video that has the -i flag?