Syntax Error (FROM) in Python, I do not want to use it as function but rather use it as to print something -


i trying print out usernames instagram. when type in print i.from.username, there syntax error because python thinks using function, not.

for in a:     print i.from.username 

is there anyway troubleshoot it? tried using making string still wrong. try did was:

for in a:     print i+ ".from." +username 

base on comments:

i'm not trying put key attribute. i'm trying collect data instagram api.

the represents comments, i'm going comments collect usernames commented.

        "text": "this #kimsoohyun 's "house" in producer!",         "from":  {           "username": "lilingchen",         }, 

if put i.text, print out every comments. now, wanted print out username commented, tried using i.from.username.

print getattr(i, 'from').username 

Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -