Faced a situation that I can not solve.
There is a function that takes data from the site by IP. When it is called, it returns data in a tuple format, and I need data in a dictionary.
How can this problem be solved?
Function code and its call
def request_auth_by_api(command='user_info', params={}): nonce = int(round(time.time()*1000)) sync_param = {"nonce": nonce} params.update(sync_param) params = urllib.urlencode(params) H = hmac.new(api_secret, digestmod=hashlib.sha512) H.update(params) sign = H.hexdigest() headers = {"Content-type": "application/x-www-form-urlencoded", "Key": api_key, "Sign": sign} try: conn = httplib.HTTPSConnection("api.exmo.com") conn.request("POST", "/v1/{}".format(command), params, headers) response = conn.getresponse() json_obj = json.load(response) status = response.status reason = response.reason conn.close() except: json_obj = {} status = False reason = False return json_obj, status, reason response = request_auth_by_api() print (type(response)) print response 