1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| parser = argparse.ArgumentParser(description='WaterMarker of argparse')
parser.add_argument('--text', default='watermark', help="Text to add watermark") parser.add_argument('-F', '--file', default='', help="The path to the file to add the watermark to") parser.add_argument('--font', default='SimSun', help="Font used for watermark text") parser.add_argument('--size', type=int, default=30, help="Font size used for watermark text, defaults to 30, " "the size will adjust itself as the page changes") parser.add_argument('--alpha', type=float, default=0.1, help="Transparency of watermark text, between 0.0 and 1.0") parser.add_argument('--angle', type=int, default=30, help="Rotate the canvas by the angle theta (in degrees)") parser.add_argument('-O', '--output', default='', help="File output path after adding watermark (including the " "file name), the default is the original file directory")
args = parser.parse_args()
|