def main(argv): try: opts, args = getopt.getopt(argv, "hf:") except getopt.GetoptError, error: print error usage() sys.exit() for o, a in opts: if o in ('-f'): coordinate = a if o in ('-h'): usage() sys.exit() print coordinate