Python
wensishuai
这个作者很懒,什么都没留下…
展开
-
testPython
file = open('xxx.txt','a') p = subprocess.Popen('dir',stdout=subprocess.PIPE,shell=True) print >>file,p.pid print >>file,p.retur原创 2011-08-09 20:26:21 · 414 阅读 · 0 评论 -
Python学习(一)——学习资源记录
下面是常用的入门和查找的资源: 官方参考文档:http://docs.python.org/release/2.6.7/index.html (学习tutorial和standard library常用函数) google的Python class:http://co原创 2011-08-09 22:34:18 · 601 阅读 · 0 评论 -
Python学习(二)——常用功能
1、获取当前时间: import time TIMEFORMAT = '%Y%m%d%H%M%S' self.curtimestr = time.strftime( TIMEFORMAT, time.localtime(time.time()))原创 2011-08-10 19:05:18 · 670 阅读 · 0 评论 -
Python学习(四)——Python单元测试
pyunit框架 ''' Created on Aug 10, 2011 @author: wensi ''' import unittest class TestClass1(unittest.TestCase): def testCase1(self):原创 2011-08-10 22:29:51 · 725 阅读 · 0 评论 -
Python学习(三)——正则表达式模块
re.match match从字符串的开头进行匹配(注意是开头!!!) text = "wensishuai is a handsome boy, he is cool, clever, and so on..." m = re.match(r'(w\w+)\s', te原创 2011-08-10 22:12:15 · 1733 阅读 · 0 评论