V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
bestehen
V2EX  ›  问与答

Python 命令行参数问题

  •  
  •   bestehen · Jul 31, 2018 · 1684 views
    This topic created in 2834 days ago, the information mentioned may be changed or developed.
    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?
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2888 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 06:27 · PVG 14:27 · LAX 23:27 · JFK 02:27
    ♥ Do have faith in what you're doing.