You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using this wrapper for a very simple purpose, getting a link of a certain gif (and quite possibly other peices of information, but just by knowing how to get a variable I can figure it out).
This is my code, and working perfectly until the part where getting the variable. I know I'm doing something wrong, but don't really know how to fix it:
search = input('Tell me a word or phrase for me to search: ')
q = search
limit = 1
lang = 'en'
fmt = 'json'
api_response = api_instance.gifs_search_get(api_key, q, limit=limit, lang=lang, fmt=fmt)
pprint(api_response)
jsonstring=json.loads(api_response)
pairs = jsonstring.items()
for key, url in pairs:
print(url)
I'm still learning how to use json (or dict strings) and how to use them, so any help appreciated!
The text was updated successfully, but these errors were encountered:
Aschinea
changed the title
Getting only the link variable from the JSON string
[Question] Getting only the link variable from the JSON string
Aug 22, 2020
Hello,
I'm using this wrapper for a very simple purpose, getting a link of a certain gif (and quite possibly other peices of information, but just by knowing how to get a variable I can figure it out).
This is my code, and working perfectly until the part where getting the variable. I know I'm doing something wrong, but don't really know how to fix it:
I'm still learning how to use json (or dict strings) and how to use them, so any help appreciated!
@af-inet
The text was updated successfully, but these errors were encountered: