我将FB post id存储在一个sqlite表中。现在我想使用post_id
查询FB图中的其他数据。下面的黑客作品,但它感觉很hokey。。。你知道吗
cur.execute("SELECT post_id FROM fbposts")
data_all = cur.fetchall()
for x in data_all:
y = "%s" % x
y
的值现在类似于96085205666_10153983162390667
,可以用来构造一个新的fbapi调用,但必须有一种更为python的方法
Tags:
使用以下模式如何:
现在您的数据将是您想要的字符串列表。如果您想为每个post\u id打电话,现在可以执行以下操作:
对于您的请求,
data_all
是1个元素的元组上的iterable要获取此元素并创建包含字符串的列表,请执行以下操作:
这将解压元组中的
x
,并创建一个字符串列表(相当于[x[0] for x in data_all]
)相关问题 更多 >
编程相关推荐