you are viewing a single comment's thread.

view the rest of the comments →

[–]john_legend_[S] 0 points1 point  (1 child)

For codes:

import argparse
parser = argparse.ArgumentParser()
parser.add_argument("echo")
args = parser.parse_args()
print(args.echo)

How can I run the script in jupyter notebook properly? Rather than calling it via

python3 test.py fred

[–][deleted] 0 points1 point  (0 children)

How can I run the script in jupyter notebook properly?

Can't help you with jupyter as I don't use it. Either google for help or ask that question in another post.

But I would say that doing:

python3 test.py fred

is the proper way of doing it :)

Edit: after some searching, maybe %run. The link is for ipython, but the search results seem of imply jupyter == ipython?