问题
I try to execute following code but can't with mistake: name 'xrange' is not defined
pages = (
requests.get(
build_group_request({
"offset": WINDOW_SIZE * i,
"count": WINDOW_SIZE,
"fields": "sex,interests,bdate"
})
).json()['response']['items']
for i in xrange(int(float(COUNT) / 100 + 1))
)
回答1:
You're probably using Python3, where xrange
has become range
.
来源:https://stackoverflow.com/questions/31104416/name-xrange-is-not-defined-in-python-3