Multiple files for one argument in argparse Python 2.7

后端 未结 2 1966
灰色年华
灰色年华 2020-12-25 12:05

Trying to make an argument in argparse where one can input several file names that can be read. In this example, i\'m just trying to print each of the file

2条回答
  •  再見小時候
    2020-12-25 13:00

    Just had to make sure there was at least one argument

    parser.add_argument('file',nargs='*')
    

提交回复
热议问题