【发布时间】:2014-10-31 15:41:33
【问题描述】:
这是我的代码,当我运行它时,第 19 行出现错误(for 循环): TypeError: object 'int' is not iterable.
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 问题;例如stackoverflow.com/questions/19523563/… 或 stackoverflow.com/questions/3887381/… 或 stackoverflow.com/questions/18595695/… 等等。