#!/usr/bin/python3 import sys from urllib.parse import urlencode import urllib.request API_URL = "http://127.0.0.1:8000/api/rms/cab/sync/db_status" def main(): args = sys.argv[1:] params = {} for index in range(len(args)): arg = args[index] if not arg.startswith('--'): continue key = arg[2:] value = args[index+1] params[key] = value encoded_params = urlencode(params) url = API_URL + '?' + encoded_params urllib.request.urlopen(url) if __name__ == '__main__': main()