![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Python
AndrewGhost
IT小虫成长记 Andrew_Ghost@yeah.net
展开
-
Python 3.x中的urllib的改动
在pyhon3.x中,对原来的urllib做了很多的修改。将Request,error,urllib2等都归一到了urllib中。下面就说明一些遇到的细节。 1.原来的urllib.urlopen改为urllib.request.urlopen(),而且开头的import urllib要改为import urllib.request. 2.urllib2.Reques原创 2015-04-04 19:49:02 · 1487 阅读 · 0 评论 -
Python逆序打印正整数
Python逆序打印正整数,递归,不使用全局变量 >>> def reverse(x): str=chr(x%10+ord('0')) if(x>=10): x=(int)(x/10) str+=reverse(x) return str; >>> reverse(123) '321'原创 2015-05-07 13:12:16 · 2904 阅读 · 0 评论