У меня есть переменная:
user = "jobrr"
И я хочу зациклить следующее, но изменить то, что представляют переменные после каждого цикла цикла (поэтому в цикле предопределите, какой будет переменная для следующего цикла)
example loop as long as y = true openurl = urllib.urlopen("https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&contributor_details&include_rts=true&screen_name="+user+"&count=3600") user = user + "a" #just for example
как я могу это сделать?
user = 'username' y = True while y: openurl = urllib.urlopen("https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&contributor_details&include_rts=true&screen_name="+user+"&count=3600") user += "a" #You have to do something in here to change y or this will be an infinite loop
user = 'username' y = True while y: openurl = urllib.urlopen("https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&contributor_details&include_rts=true&screen_name="+user+"&count=3600") user = function_that_returns_user_name()
вам нужно только определить function_that_returns_user_name()
function_that_returns_user_name()