0
这是我的代码,当我运行它时,我得到第19行(for循环)的错误: TypeError:object'int'不可迭代。Python类型错误对象int不可迭代
import fb
from facepy import GraphAPI
token=""# access token here.
facebook=fb.graph.api(token)
graph1 = GraphAPI(token)
vid="" #page id here
query=str(vid)+"/feed"
r=graph1.get(query)
count=0
nos=input("Enter number of posts: ")
for indid in nos:
count=count+1
facebook.publish(cat="feed",id=indid,message="Hi"+str(count))
time.sleep(6)
print("Wall post:"+str(count))
else :
print("No posts made.")
请告诉我什么是错的。
请做一些研究,这是一个非常基本的错误,只是简单地用你的错误信息谷歌应该引导你许多SO问题相同的问题;例如https://stackoverflow.com/questions/19523563/python-typeerror-int-object-is-not-iterable或https://stackoverflow.com/questions/3887381/typeerror-nonetype-object-is-not-iterable- in-python或者https://stackoverflow.com/questions/18595695/python-typeerror-int-object-is-not-iterable et cetera。 – l4mpi 2014-10-31 07:39:23