
python
iteye_20463
这个作者很懒,什么都没留下…
展开
-
python修改文件尺寸
python对图片的操作需要使用到(Python Imaging Library)PIL库,PIL可以处理几乎所有的图片类型,了解更多请点击这里(可能被墙请自带梯子)。1.下载PIL并安装 windows:直接下载对应的安装包 linux:yum install python-imaging或sudo apt-get install python-imaging...2012-08-18 21:35:07 · 249 阅读 · 0 评论 -
python操作mysql数据库
python操作mysql需要用到MySQLdb这个库。 1.下载MySQLdb,点击这里下载(可能被墙请自带梯子) 2.使用 import MySQLdbtry: con = MySQLdb.connect(host='192.168.1.100', user='myuser', passwd='123456', port='3306', db='mydb'...2012-08-19 12:38:08 · 112 阅读 · 0 评论 -
python的web框架webpy(一)
python的web框架是一个百花齐放的世界,完全列表请看这里。 面对如此众多的框架我们要如何选择!它们都有各自的优缺点,你不可能找到一款完美的,其实只需要选择适合的即可! 这里介绍webpy,进入官方首页你可以看到右边有一个hello word的例子 import web urls = ( '/(.*)', 'hello')app ...2012-08-26 18:02:38 · 380 阅读 · 0 评论 -
python的web框架webpy(二)
之前介绍了webpy,还写了一个自己的web程序,下面我们就来分析下代码。 # coding:utf-8import weburls=( '/','index')app=web.application(urls,globals())class index: def GET(self): return 'hello w...2012-08-26 19:37:32 · 140 阅读 · 0 评论 -
python的web框架webpy【路由规则】(三)
今天重点说下webpy的路由规则。 #这里声明了三条路由规则,它是一个tuple,由url匹配规则和处理类组成#url匹配规则是用正则表达式书写的#可以声明多条路由规则,每一条都是由url匹配规则和处理类组成urls=( '/','index', '/user','user', '/topic','topic') 既然ur...原创 2012-08-26 20:39:25 · 898 阅读 · 0 评论 -
python的web框架webpy【Templetor】(四)
之前我们讲的都是简单的返回文本到浏览器,例如下面将会返回hello word到浏览器 # coding:utf-8import weburls=( '/','index')app=web.application(urls,globals())class index: def GET(self): return 'he...2012-08-27 23:21:01 · 166 阅读 · 0 评论 -
python的web框架webpy【session & cookie】五
webpty中使用session非常简单 import webweb.config.debug = Falseurls = ( "/count", "count", "/reset", "reset")app = web.application(urls, locals())session = web.session.Session(app,...原创 2012-09-09 10:46:25 · 300 阅读 · 0 评论 -
python的web框架webpy 六
webpy中获取get和post参数的方式非常简单 args=web.input()name=args.get('name')age=args.get('age')sex=args.get('sex') 需要注意的是上面方法获得的参数的类型全是unicode,所以对于数值需要作相应的类型转换才能使用 获得上传的文件 args=web.inpu...2012-09-09 10:57:04 · 181 阅读 · 0 评论