Passing command line arguments to argv in jupyter/ipython notebook

前端 未结 8 1285
-上瘾入骨i
-上瘾入骨i 2020-11-28 09:34

I\'m wondering if it\'s possible to populate sys.argv (or some other structure) with command line arguments in a jupyter/ipython notebook, similar to how it\'s

8条回答
  •  感情败类
    2020-11-28 10:26

    sys.argv yields a list, so I used

    sys.argv.append('hello')
    

    in a jupyter notebook, which allowed me to append extra members and pretend like I'm passing in arguments from the command line.

提交回复
热议问题