How to call module written with argparse in iPython notebook

后端 未结 9 1492
半阙折子戏
半阙折子戏 2020-12-29 02:04

I am trying to pass BioPython sequences to Ilya Stepanov\'s implementation of Ukkonen\'s suffix tree algorithm in iPython\'s notebook environment. I am stumbling on the argp

9条回答
  •  暖寄归人
    2020-12-29 02:38

    Here is my code which works well and I won't worry about the environment changed.

    import sys
    temp_argv = sys.argv
    
    try:
        sys.argv = ['']
        print(sys.argv)
        args = argparse.parser_args()
    finally:
        sys.argv = temp_argv
        print(sys.argv)
    

提交回复
热议问题