How to call module written with argparse in iPython notebook

后端 未结 9 1486
半阙折子戏
半阙折子戏 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条回答
  •  -上瘾入骨i
    2020-12-29 02:39

    I face a similar problem in invoking argsparse, the string '-f' was causing this problem. Just removing that from sys.srgv does the trick.

    import sys
    if __name__ == '__main__':
        if '-f' in sys.argv:
            sys.argv.remove('-f')
        main()
    

提交回复
热议问题