suppose I have the following script:
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-t','--text',
help="Input a text")
args = parser.parse_args()
def test_function(x):
y = x
print(y)
if __name__ == '__main__':
test_function(args.text)
which I call from the console with
python newtest.py -t hello
Question: In Visual Code, is there a way that I can execute the code from the command line (like shown above), but simultaneously also put a breakpoint at e.g. at the y=x
line in the test_function
, so that I can debug the script that I have called from the command line?
Right now it is just executed and the breakpoint is ignored, basically it does not stop here: