V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
bestehen
V2EX  ›  问与答

Python 命令行参数问题

  •  
  •   bestehen · 2018-07-31 14:49:19 +08:00 · 1180 次点击
    这是一个创建于 2100 天前的主题,其中的信息可能已经有所发展或是发生改变。
    parser = argparse.ArgumentParser()
    parser.add_argument('input_pdf_path', metavar='PATH')
    parser.add_argument('-o', '--output', metavar='out', type=argparse.FileType('wb'),
    help='Output PDF file')
    parser.add_argument('-s', '--skip', type=int, default=0,
    help='Skip over the first n page(s).')
    args = parser.parse_args()

    args.output.write(img2pdf.convert(*list(map(img2pdf.input_images, images_path))))

    这里的 output.write 啥意思? 还有--output?
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2235 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 02:43 · PVG 10:43 · LAX 19:43 · JFK 22:43
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.