When I try to run a multi-line script with the Python debugger pdb, I get an error.
(Pdb) if root_task in task_sets['completed']:
*** SyntaxError: unexpected EOF while parsing
In this case, use the ʻinteract` command to launch the python interpreter shell.
(Pdb) interact
*interactive*
>>> if root_task in task_sets['completed']:
... completed_tasks = task_sets['completed']
... for key in task_sets.keys()
Since the variable name in the pdb state inherits the value, you can write a normal Python script as it is.
https://docs.python.org/3/library/pdb.html
interact Start an interactive interpreter (using the code module) whose global namespace contains all the (global and local) names found in the current scope. New in version 3.2.
Recommended Posts