摘要: SQLite 是个轻量级的数据库系统,无需系统服务,只有一个db文件,可移植性很好。 如果有大量数据需要处理的话是个很好的选择。 SQLite 安装 Windows下使用Python2.5版本可以直接使用。 在Linux下面需要先装sqlite再装Python否则会出现“No module named _sqlite3”的错误: >>> import sqlite3Trac... 阅读全文
posted @ 2010-01-09 18:38 真功夫 阅读(2521) 评论(0) 推荐(0) 编辑
摘要: Python 文件处理很简单,使用内置的文件类. 请看下面的例子: 打开一个文件 #open返回一个文件类infile = open("file_name")   #读整个文件内容到 file_contentfile_content = infile.read()   #读取所有行,存为list(列表)infile.seek(0)fi... 阅读全文
posted @ 2010-01-09 18:38 真功夫 阅读(530) 评论(0) 推荐(0) 编辑
摘要: 在使用urllib的时候经常会死掉,以前debug过,是没有设置 timing out 所以超时后就会死掉。 PycURL是curl的python库,虽然有些curl的功能没有实现,但是还是很强劲的。 curl是非常强劲的一个工具, google内部用它来 debug GDATA API. Using cURL to interact with Google data services 可以去... 阅读全文
posted @ 2010-01-09 18:37 真功夫 阅读(1264) 评论(0) 推荐(0) 编辑
摘要: python 为我们提供了 poplib 模块,利用这个模块,我们可以很方便的收取邮件。 # -*- coding=GBK -*-   import stringimport poplibimport StringIO, rfc822   servername = "pop3.126.com"username = "usern... 阅读全文
posted @ 2010-01-09 18:37 真功夫 阅读(1444) 评论(0) 推荐(0) 编辑
摘要: 使用Python自带的cgi库,可以很容易的实现CGI编程。 下面的例子实现了使用 类FieldStorage 得到POST或GET参数的方法 表单示例 <form method="POST" action="http://host.com/cgi-bin/test.py"> <p>Your first name: <inp... 阅读全文
posted @ 2010-01-09 18:36 真功夫 阅读(2758) 评论(1) 推荐(0) 编辑
摘要: 在使用urllib的时候经常会死掉,以前debug过,是没有设置 timing out 所以超时后就会死掉。 PycURL是curl的python库,虽然有些curl的功能没有实现,但是还是很强劲的。 curl是非常强劲的一个工具, google内部用它来 debug GDATA API. Using cURL to interact with Google data services 可以去... 阅读全文
posted @ 2010-01-09 18:34 真功夫 阅读(834) 评论(0) 推荐(0) 编辑
摘要: [1]使用PyExcelerator读写EXCEL文件(Platform: Win,Unix-like) 优点:简单易用      缺点:不可改变已存在的EXCEL文件。 PyExcelerator是一个开源的MS Excel文件处理python包。它主要是用来写 Excel 文件.URL:  http://sourceforge.net... 阅读全文
posted @ 2010-01-09 18:22 真功夫 阅读(3980) 评论(0) 推荐(0) 编辑
摘要: Python控制Photoshop(Python+Com)#这个脚本演示了如何控制PhotoshopCS。#功能:打开D:\\32.bmp文件from win32com.client import DispatchPHApp = Dispatch("Photoshop.Application")numDocs = PHApp.Documents.countif numDocs ... 阅读全文
posted @ 2010-01-09 18:20 真功夫 阅读(3758) 评论(1) 推荐(0) 编辑
摘要: 有时候困了,想睡觉,又想听歌,但是给电有限制,所以就写了这个小程序,这样就不担心睡着了后,没法关机了。 import os,time,sys o="c:\\windows\\system32\\shutdown -s" print "Input the hours and minutes:" h=input() mt=input() t=time.loca... 阅读全文
posted @ 2010-01-09 18:19 真功夫 阅读(1892) 评论(1) 推荐(0) 编辑
摘要: libcurl的使用简单例子(python) 3     关于libcurl 4     libcurl is a free and easy-to-use client-side URL transfer library, supporting FTP, FTPS, HTTP, HTTPS, SCP, SFTP, T... 阅读全文
posted @ 2010-01-09 18:18 真功夫 阅读(2847) 评论(0) 推荐(0) 编辑