Beispiel: python Crawl_Flickr.py -s $pwd 37.685364 -121.773031 37.686364 -121.772931
Crawl_Flickr.py: error: no such option: -1
Die "-1" von -121.773031 wurde als Argument erwartet.
Code: Alles auswählen
from optparse import OptionParser
parser = OptionParser("Crawl_Flickr.py [Operation] Latitude_1 Longitude_2 Latitude_2 Longitude_2")
parser.add_option("-s", "--save", dest="save_file", help="Save file to directory")
(args) = parser.parse_args()
save_dir = save_file.save_file
if len(args) != 4:
parser.error("4 Arguments were needed: Latitude_1 Longitude_2 Latitude_2 Longitude_2")
else:
lat1=args[0]
lon1=args[1]
lat2=args[2]
lon2=args[3]