ChinaUnix.net
相关文章推荐:

python3 练习

import urllib.request import sys import json for i in range(1300000, 1300001): url ='http://api.showji.com/Locating/default.aspx?m=%s&output=json' % i response = urllib.request.urlopen(url) try: for line in response.readlines(): file = open("1.txt", 'a') line = line.decode() print(type(line)) line += '\n' print(line) file.write(line) finally: file.close() #sys.exit() ...

by seacoastboy - Python - 2009-08-07 13:09:16 阅读(1354) 回复(2)

相关讨论

def _decodeHtmlEntity(s):     '''十进制unicode转换'''     import re     result = s     entityRe = '( &# (\\d{5}); )'     entities = re.findall(entityRe, s)     for entity in entities :             result = result.replace...

by seacoastboy - Python - 2009-06-03 08:58:40 阅读(1278) 回复(2)

import urllib.response 报错 Traceback (most recent call last): File "E:/py/urllib.py", line 2, in import urllib.response File "E:/py\urllib.py", line 2, in import urllib.response ImportError: No module named response 不知道什么原因 [ 本帖最后由 seacoastboy 于 2009-2-1 09:41 编辑 ]

by seacoastboy - Python - 2009-02-11 09:16:39 阅读(1637) 回复(2)

大家用python3多吗? 现在在python3下操作mysql数据库是不是没办法啊。。

by seacoastboy - Python - 2009-02-02 15:26:37 阅读(1950) 回复(9)

一点贡献 跟着大家混了这么久了 是别人的 入门的下载去看看吧

by aol365 - Python - 2012-12-17 12:36:12 阅读(6278) 回复(10)

如题,初学者请教各位,如何去学习这个新版本呢?也找不到相关的文档。还望指教。

by lsj020231 - Python - 2009-10-16 13:41:03 阅读(1343) 回复(3)

python3.1的change log里有这样一句 - Issue #4753: By enabling a configure option named '--with-computed-gotos' on compilers that support it (notably: gcc, SunPro, icc), the bytecode evaluation loop is compiled with a new dispatch mechanism which gives speedups of up to 20%, depending on the system, on various benchmarks. 看来python会更多的关注性能了。 大家应该多关注python3.x的发展,虽说库现...

by zxh9813 - Python - 2009-03-31 09:23:04 阅读(2411) 回复(2)

http://blog.chinaunix.net/u1/42287/showart_371568.html http://www.python.org/ftp/python/3.0/python-3.0a1.tgz http://docs.python.org/dev/3.0/

by 23号 - Python - 2007-08-31 17:15:45 阅读(2335) 回复(1)

http://www.python.org/ftp/python/3.0/python-3.0a1.tgz http://docs.python.org/dev/3.0/ 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/42287/showart_371568.html

by 23号 - Python文档中心 - 2007-08-31 09:05:50 阅读(805) 回复(0)

当要使函数接收元组或字典形式的参数的时候,有一种特殊的方法,它分别使用*和**前缀。这种方法在函数需要获取可变数量的参数的时候特别有用。例子: 其中:使用字典的items方法,来使用字典中的每个键/值对。 [color="#008080"]##encoding:utf-8 [color="#008080"]# parameter_tuple.py [color="#0000ff"]def [color="#000000"]avarage([color="#00c600"]*[color="#808000"]tuple[color="#00...

by wibrst - Python文档中心 - 2006-12-13 13:04:21 阅读(820) 回复(0)

python3.0用什么来打包????网上找的全是python2.6的(py2exe)

by 我不是老手 - Python - 2009-05-25 09:05:46 阅读(1591) 回复(2)