返回信息流谢谢各位
这是一条镜像帖。来源:北邮人论坛 / www-technology / #14141同步于 2011/7/19
该镜像源已超过 30 天没有更新,可能在源站已被删除。
WWWTechnology机器人发帖
求助!python里字符串最大长度65535B,怎么设定更大的?
txmm
2011/7/19镜像同步5 回复
订阅后,新回复会通过你的通知中心匿名送达。
5 条回复
In [1]: import urllib2
In [2]: ret = urllib2.urlopen("http://news.163.com/")
In [3]: content = ret.read()
In [4]: len(content)
Out[4]: 305536
你这个“python里字符串最大长度65535B“从何而来?
为什么?为什么?为什么?不可能吧?
[wks@localhost ~]$ python
Python 2.7 (r27:82500, Sep 16 2010, 18:02:00)
[GCC 4.5.1 20100907 (Red Hat 4.5.1-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> txt = "".join("a" for x in xrange(1000000))
>>> len(txt)
1000000
>>>
【 在 txmm 的大作中提到: 】
: 恩?那就是我理解有错误。。
: 可能是从数据库里读的数据。就是for row int cursor.fetchall的那个
: 貌似读满65535就停止了。。
: ...................
fetchall不应该返回一个tuple么。。