所有人,
这可能是一个非常棘手的问题,但我对如何在沙尔这样做感到困惑。 我需要做的是,在要求Panaramio提供数据时,要从寄生虫中找到。
from=0&to=100/strong>&minx=180&miny=-90&ma=180&maxy=90&size=medium&
Panoramio only allows you to return 100 records at a time so I need to build out the url string to show the advancement of the sets of 100. eg. 101-200, 201-300, etc. Is there an example anywhere that will show me how to do this type of paging using Python?
Thanks, Adam
UPDATE: The following example seems to do what I want it to do. Now I have to figure out how to do the actual iteration from 101-200, 201-300, etc...From there I can take those values and build out my query string. Does this make sense?
def counter(low, high):
current = low
while current <= high:
yield current
current += 100
if __name__ == __main__ :
for c in counter(100, 200):
print c
附录 第2号:我是这样说的。
def counter(low, high):
while low <= high:
yield low, high
low += 100
high += 100
for i in counter(1, 100):
print i