Python变量返回“生成器对象”

时间:2016-01-08 10:58:31

标签: python

我正在编写一些测试代码,但提交变量正在返回<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div> </div>

该变量应返回提交列表,类似于此

<generator object get_content at 0x009D9930>

这是代码,这个库就像praw一样。

['10 :: Gun.io Debuts Group Funding for Open Source Projects\n Gun.io',
 '24 :: Support the Free Software Foundation',
 '67 :: The 10 Most Important Open Source Projects of 2011',
 '85 :: Plan 9 - A distributed OS with a unified communicatioprotocol  I/O...',
  '2 :: Open-source webOS is dead on arrival ']

1 个答案:

答案 0 :(得分:2)

理解不会修改对象;他们创造了一个新的。您必须保存参考。

submissions = [str(x) for x in submissions]