02 2015 档案

摘要:from time import ctime,sleepdef music(): for i in range(2): print ("I was listening to music. %s" %ctime()) sleep(1)def move(): fo... 阅读全文
posted @ 2015-02-28 15:49 小毛驴 阅读(195) 评论(0) 推荐(0)
摘要:class Person:def __init__(self, name):self.name = namedef sayHi(self):print('Hello, my name is'+ self.name)p = Person('Swaroop')p.sayHi() 阅读全文
posted @ 2015-02-27 15:11 小毛驴 阅读(140) 评论(0) 推荐(0)
摘要:print('Hello World')print('%s',55)print('%6.2f' % 1.235)print('%06.2f' % 1.235)print('-%06.2f' % 1.235)print('%-09.2f' % 1.235)print('%+09.2f' % 1.235... 阅读全文
posted @ 2015-02-27 10:12 小毛驴 阅读(373) 评论(0) 推荐(0)
摘要:接下来我们看一下SpringNetAop层的内容;此层主要是实现一些AOP的代码,以及特性和一个统一调用spring.net的类;记录日志我们使用Log4Net来实现;1:Aspects 文件夹里存放的几个类分别是Spring.net几种AOP的通知模式;因为本实例主要是要演示异常的调用所以我们调用... 阅读全文
posted @ 2015-02-26 14:09 小毛驴 阅读(331) 评论(0) 推荐(0)
摘要:上午在园子里乱逛,看了不少小伙伴们分享的接口测试方面的知识,大家所叙述到的一些经验或多或少,我也曾遇到过,突然意识到知识的点滴积累是多么的重要,我记得我最早接触接口测试的时候,就是只在浏览器里人工测试单个接口的返回结果,后来用python的unittest自己写测试框架,和现在大多数小伙伴们的方法... 阅读全文
posted @ 2015-02-26 09:20 小毛驴 阅读(774) 评论(0) 推荐(0)
摘要:for i in range(100,-1,-1): print "%s\n"%i;importospath ='D:\\Test'forroot, dirs, files inos.walk(path):print("Root = ", root, "dirs = ", dirs, "fil... 阅读全文
posted @ 2015-02-25 17:51 小毛驴 阅读(217) 评论(0) 推荐(0)
摘要:import osa = os.walk('.') for i in a: print(i) 阅读全文
posted @ 2015-02-25 17:22 小毛驴 阅读(120) 评论(0) 推荐(0)
摘要:TimeZone.CurrentTimeZone.ToLocalTime /// /// 时间戳转为C#格式时间 /// /// Unix时间戳格式 /// C#格式时间 public static DateTime ... 阅读全文
posted @ 2015-02-25 08:56 小毛驴 阅读(360) 评论(0) 推荐(0)
摘要:11、压力测试与负载测试? 负载测试:通常运行时间比较短,在系统上逐渐加压,直到性能指标达到饱和状态(比如相应时间超出预期要求、系统资源占用率居高不下等),从而验证系统预期的性能目标、相应时间等。 压力测试:长时间运行,逐渐增加超负荷(并发、循环、多用户等),直到系统产生异常以及对异常的处理能... 阅读全文
posted @ 2015-02-22 10:21 小毛驴 阅读(375) 评论(0) 推荐(0)
摘要:import urllib.requesturl="http://mm.taobao.com/json/request_top_list.htm?type=0&page=1"up=urllib.request.urlopen(url)#打开目标页面,存入变量upcont=up.read()#从up中... 阅读全文
posted @ 2015-02-16 09:58 小毛驴 阅读(304) 评论(0) 推荐(0)
摘要:sc query WCService | find /i "state"if %errorlevel% == 0 ( net start "WCService") else ( C:\Windows\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe... 阅读全文
posted @ 2015-02-07 15:24 小毛驴 阅读(168) 评论(0) 推荐(0)
摘要:import reimport urllib.request def getHtml(url): page = urllib.request.urlopen(url) html = page.read() return str(html)def getImg(html): r... 阅读全文
posted @ 2015-02-03 21:56 小毛驴 阅读(233) 评论(0) 推荐(0)
摘要:importurllib.requestproxy_support=urllib.request.ProxyHandler({})opener=urllib.request.build_opener(proxy_support)urllib.request.install_opener(opener... 阅读全文
posted @ 2015-02-03 14:25 小毛驴 阅读(844) 评论(0) 推荐(0)
摘要:import urllib.requestimport http.cookiejarfrom urllib.error import URLError,HTTPError import urllib.request import urllib.parse url='http://www.bai... 阅读全文
posted @ 2015-02-03 11:22 小毛驴 阅读(215) 评论(0) 推荐(0)
摘要:下面这个例子是我写了个文件替换的小程序。替换所有.html文件里的图片的路径import osimport ret = re.compile(r'\/?static\/|\/?media\/') #re.compiletemplate = '/home/laowangpython/'for root... 阅读全文
posted @ 2015-02-03 11:02 小毛驴 阅读(131) 评论(0) 推荐(0)
摘要:这个地址应该比较的好下载,以前找的地址都是需要输入一些相关的信息。这个只需要有一个HP的注册账号就可下载,记下来。以备后用:下载地址:http://www8.hp.com/us/en/software/software-product.html?compURI=tcm:245-935779#。关于l... 阅读全文
posted @ 2015-02-01 15:19 小毛驴 阅读(390) 评论(0) 推荐(0)
摘要:from selenium import webdriverimport time def capture(url, save_fn="capture.png"): browser = webdriver.Firefox() # Get local session of firefox bro... 阅读全文
posted @ 2015-02-01 14:27 小毛驴 阅读(663) 评论(0) 推荐(0)
摘要:http://sariyalee.iteye.com/blog/1680815 阅读全文
posted @ 2015-02-01 13:54 小毛驴 阅读(117) 评论(0) 推荐(0)