在jupyter notebook中使用argparse显示: usage: ipykernel_launcher.py [-h] [--try_arg TRY_ARG] ipykernel_launcher.py: error: unrecognized arguments: -f An exception has occurred, use %tb to see the full traceback. SystemExit: 2
这个可能是因为IPython的问题,args不应为空。
将args = parser.parse_args( )改为args = parser.parse_args(args=[ ])