すべての検索結果をリストに入れようとしています。ここでtweepy.Cursorが同じユーザーを何度も返す
はコードです:私はすべて取得するにはどうすればよい
1 19081001
2 313527365
3 89528870
4 682463
5 2607583036
6 219840627
7 725883651280363520
8 371980318
9 860066587
10 4794574949
11 88633646
12 137482245
13 1447284511
14 15369494
15 171657474
16 442113112
17 6130932
18 2587755194
19 191338693
20 528804165
21 19081001
22 313527365
23 89528870
24 682463
25 2607583036
26 219840627
27 725883651280363520
28 371980318
29 860066587
30 4794574949
30
:
cursor = tweepy.Cursor(api.search_users,"foo")
count = 0
for u in cursor.items(30):
count += 1
print count, u.id_str
print count
ああ、項目1は2が22 & Cと同じで、21と同じですの検索結果?
要求通り:tweepy documentation 1として
dir(cursor)
['__class__',
'__delattr__',
'__dict__',
'__doc__',
'__format__',
'__getattribute__',
'__hash__',
'__init__',
'__module__',
'__new__',
'__reduce__',
'__reduce_ex__',
'__repr__',
'__setattr__',
'__sizeof__',
'__str__',
'__subclasshook__',
'__weakref__',
'items',
'iterator',
'pages']
あなたがそれを使って何ができるかを見るには、 'dir(カーソル)'を試してください。あなたが何か驚くべきものを見つけられないなら、それはpythonic解決策でなければならないでしょう。 –
私はそれを質問テキストに追加しましたが、これは_repeated_出力にどのように関連するのか分かりません。 – sds
あなたは何を達成しようとしていますか?質問に明確に要件を追加してください。 – kmario23