I am getting my feet wet with Python. I never done any programming or what so ever before and I really would appreciate it if someone would explain his_hers answer and not just post it since I want to learn something! Even better would be not posting the answere, but just giving hints what I should look at or something :)
I have several lists with a lot of values (numbers) one the one side. On the other side, I have a URL which needs to be updated by the numbers out of the several lists and then be saved into another list for further process.
#borders of the bbox
longmax = 15.418483 #longitude top right
longmin = 4.953142 #longitude top left
latmax = 54.869808 #latitude top
latmin = 47.236219 #latitude bottom
#longitude
longstep = longmax - longmin
longstepx = longstep / 100 #longitudal steps the model shall perfom
#latitude
latstep = latmax - longmin
latstepx = latstep / 100 #latitudal steps the model shall perform
#create list of steps through coordinates longitude
llong = []
while longmin < longmax:
longmin+=longstepx
llong.append(+longmin)
#create list of steps through coordinates latitude
llat = []
while latmin < latmax:
latmin+=latstepx
llat.append(+latmin)
#create the URLs and store in list
for i in (llong):
"https://api.flickr.com/services/rest/?method=flickr.photos.search&format=json&api_key=5....lback=1&page=X&per_page=500&bbox=i&accuracy=1&has_geo=1&extras=geo,tags,views,description",sep="")"
As you can see, I try to make a request to the REST API from flickr. What I dont understand is:
- How do I get the loop to go through my lists, insert the values from the list to a certain point in the URL?
- How to I tell the loop to save each URL separately after it inserted the first number out of list "llong" and "llat" and then proceed with the two next numbers.
Any hints?