Advertisement
Halbheld

command_line.py

Nov 13th, 2019 (edited)
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. import argparse
  2. parser = argparse.ArgumentParser()
  3. parser.add_argument("-u", "--url", help="URL to an online JPG or PNG file", default="http://www.haemmern.de/live/bild.jpg")
  4. parser.add_argument("-iw", "--width", help="Image width", default="640")
  5. parser.add_argument("-ih", "--height", help="Image height", default="480")
  6. parser.add_argument("-x", "--posx", help="Horizontal position of the image on desktop in pixel", default="20")
  7. parser.add_argument("-y", "--posy", help="Vertical position of the image on desktop in pixel", default="20")
  8. parser.add_argument("-t", "--time", help="Refresh duration in seconds", default="60")
  9. args = parser.parse_args()
  10.  
  11. if args.url:
  12.     print("URL "+args.url)
  13.    
  14. if args.width:
  15.     print("Breite "+args.width)
  16.    
  17. if args.height:
  18.     print("Hoehe "+args.height)
  19.  
  20. if args.posx:
  21.     print("Position X "+args.posx)
  22.  
  23. if args.posy:
  24.     print("Position Y "+args.posy)
  25.    
  26. if args.time:
  27.     print("Duration "+args.time)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement