上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 21 下一页
摘要: """Generic socket server classes. 2 3 This module tries to capture the various aspects of defining a server: 4 5 For socket-based servers: 6 7 - address family: 8 - AF_INET{,6}: IP (Internet Protocol) sockets (default) 9 - AF_UNIX: Unix domain socke... 阅读全文
posted @ 2012-08-19 01:06 苍术厚朴 阅读(857) 评论(0) 推荐(0) 编辑
摘要: 需要看懂以下代码:需参考http://docs.python.org/dev/library/tokenize.html#tokenize.tokenize#!/usr/bin/env python# author: Hua Liang [ Stupid ET ]# email: et@everet.org# website: http://EverET.org## Grammar:# expr ::= expr addop term | term# term ::= term mulop factor | factor# factor ::= nu... 阅读全文
posted @ 2012-08-18 22:55 苍术厚朴 阅读(4723) 评论(1) 推荐(0) 编辑
摘要: 高级一些的编辑器,都会包含宏功能,vim当然不能缺少了,在vim中使用宏是非常方便的::qx 开始记录宏,并将结果存入寄存器xq 退出记录模式@x 播放记录在x寄存器中的宏命令稍微解释一下,当在normal模式下输入:qx后,你对文本的所有编辑动作将会被记录下来,再次输入q即退出了记录模式,然后输入@x对刚才记录下来的命令进行重复,此命令后可跟数字,表示要重复多少次,比如@x20,可以重复20次。这个在文本的批处理中是非常有用的。同时编辑多个文件在vim众多的插件中,有一个叫minibuffer的插件,就是下面所说的标签页功能了,可以支持同时编辑多个文件。标签命令:tabe fn 在一个新的标 阅读全文
posted @ 2012-08-18 12:43 苍术厚朴 阅读(145) 评论(0) 推荐(0) 编辑
摘要: python自动化web测试文档包含的内容: 1.web自动化说明与框架 2. web自动化测试例子 3.环境的搭建(附录) 近期,由于对需要对迪备产品进行web测试,上网找了些关于python进行自动化测试的资料,发现进行Web测试,可以通过Webdriver去模拟用户的操作,当前比较出色就是splinter+selenuim,基本上支持IE,fixfox和chrome浏览器的基本操作。 有了第三方模拟浏览器工具的帮助,然后就要想想产品的测试框架了,因为我们的产品基本上进行的是功能测试,而python自己自带的unitt... 阅读全文
posted @ 2012-08-17 17:44 苍术厚朴 阅读(1421) 评论(0) 推荐(0) 编辑
摘要: #-*-coding:utf-8-*-from __future__ import with_statementimport osimport unittestimport timefrom splinter import Browserfrom random import randintclass DbackupTestCase(unittest.TestCase): @classmethod def setUpClass(cls): cls.browser = Browser('firefox') @classmethod def setDownCla... 阅读全文
posted @ 2012-08-17 10:48 苍术厚朴 阅读(2819) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env python请参考http协议:import socketimport reimport sysdef check_webserver(address, port, resource): #build up HTTP request string if not resource.startswith('/'): resource = '/' + resource request_string = "GET %s HTTP/1.1\r\nHost: %s\r\n\r\n" %(resource,address) p 阅读全文
posted @ 2012-08-17 02:00 苍术厚朴 阅读(474) 评论(0) 推荐(0) 编辑
摘要: 具体文档参见:http://docs.python.org/library/xml.etree.elementtree.html例子:#-*-coding:utf-8-*-from xml.etree import ElementTree as ETfile = ET.parse('ftp.xml')ftps = file.findall('/ftp')for ftp in ftps: print ftp.attrib print ftp.get('name') print ftp.get('ip') print ftp.get( 阅读全文
posted @ 2012-08-17 01:27 苍术厚朴 阅读(372) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/env pythonimport ftplibimport osclass FTPSync(object): def __init__(self,host,username, password, ftp_base_dir, local_base_dir, delete=False): self.host = host self.username = username self.password = password self.ftp_base_dir = f... 阅读全文
posted @ 2012-08-17 00:32 苍术厚朴 阅读(415) 评论(0) 推荐(0) 编辑
摘要: Some _mysql examplesOkay, so you want to use _mysql anyway. Here are some examples.The simplest possible database connection is:import _mysqldb=_mysql.connect()This creates a connection to the MySQL server running on the local machine using the standard UNIX socket (or named pipe on Windows), your l 阅读全文
posted @ 2012-08-17 00:29 苍术厚朴 阅读(1307) 评论(0) 推荐(0) 编辑
摘要: Answer to QuestionsWhy do we need XML parser?We need XML parser because we do not want to do everything in our application from scratch, and we need some "helper" programs or libraries to do something very low-level but very necessary to us. These low-level but necessary things include che 阅读全文
posted @ 2012-08-15 22:28 苍术厚朴 阅读(339) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 21 下一页