How do I run a simple loop in VS Code's python debug console? When I try to enter the following:
for el in dataset:
It gives me the error below. I seem to be able to enter variable names, but not multi-line commands like I can in the normal python REPL.
Traceback (most recent call last):
File "/home/tensorflow/.local/lib/python3.6/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vars.py", line 416, in evaluate_expression
compiled = compile(_expression_to_evaluate(expression), '<string>', 'eval')
File "<string>", line 1
for el in dataset:
^
SyntaxError: invalid syntax
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/tensorflow/.local/lib/python3.6/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_comm.py", line 969, in internal_evaluate_expression_json
pydevd_vars.evaluate_expression(py_db, frame, expression, is_exec=True)
File "/home/tensorflow/.local/lib/python3.6/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vars.py", line 368, in new_func
return _run_with_unblock_threads(original_func, py_db, curr_thread, frame, expression, is_exec)
File "/home/tensorflow/.local/lib/python3.6/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vars.py", line 336, in _run_with_unblock_threads
return _run_with_interrupt_thread(original_func, py_db, curr_thread, frame, expression, is_exec)
File "/home/tensorflow/.local/lib/python3.6/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vars.py", line 307, in _run_with_interrupt_thread
return original_func(py_db, frame, expression, is_exec)
File "/home/tensorflow/.local/lib/python3.6/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_vars.py", line 418, in evaluate_expression
Exec(_expression_to_evaluate(expression), updated_globals, frame.f_locals)
File "/home/tensorflow/.local/lib/python3.6/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_exec2.py", line 3, in Exec
exec(exp, global_vars, local_vars)
File "<string>", line 1
for el in dataset:
^
SyntaxError: unexpected EOF while parsing
You have 2 options:
Enter
Shift+Enter
. When the command is complete, execute with Enter