hawk

导航

2013年1月3日 #

Python 实现在对一个目录下所有文件,指定某一行之后添加内容(批处理脚本)

摘要: 1 #folder for output 2 outDir = "D:\\ddd" 3 #After which line start to add new sentence 4 startAdd = 'Telnet WatchFor Fail "ERROR"' 5 #The keyword checked sentence we wanna add 6 ItemAdd = ['Telnet WatchFor Fail "Error"','Telnet WatchFor Fail "e 阅读全文

posted @ 2013-01-03 15:48 hawkgogo 阅读(619) 评论(0) 推荐(0) 编辑

2011年11月16日 #

python 实现的 直接插入排序法

摘要: str=input('plz input some numbers for sorting without any separate')doit=list(str)for a in range(1,len(doit)): for b in range(a): if doit[a] > doit[b]: continue else: substitute=doit[a] del doit[a] doit.insert(b,substitute) breakprint(doit)自己写的直接插入排序法,正在不断学习python中。。。 阅读全文

posted @ 2011-11-16 16:17 hawkgogo 阅读(200) 评论(0) 推荐(0) 编辑

python 中 sort()函数所带的参数

摘要: >>> a=range(10)>>> b=a[::-1]>>> a[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]>>> b[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]>>> c=zip(a,b)>>> c[(0, 9), (1, 8), (2, 7), (3, 6), (4, 5), (5, 4), (6, 3), (7, 2), (8, 1), (9, 0)]>>> c.sort(key=lambda x:x[0])>>> 阅读全文

posted @ 2011-11-16 14:31 hawkgogo 阅读(821) 评论(0) 推荐(0) 编辑

2011年11月10日 #

转载过来的python if __name__ ='__main__'的解释

摘要: 转自http://www.cnblogs.com/jansen2008/archive/2009/08/01/1536518.htmltest.pydeftest():print"testisrunning"if__name__=="__main__":#自运行时调用该程序块print"testmainisworking"if__name__=="test":#import时调用该程序块print"testisinvoked"自执行效果如图: import执行效果如图: 执行test()方法效果 阅读全文

posted @ 2011-11-10 11:13 hawkgogo 阅读(122) 评论(0) 推荐(0) 编辑

2011年11月9日 #

自学的网站,不断更新中

摘要: http://www.w3school.com.cn/html/html_intro.asp自学HTML的网站。 阅读全文

posted @ 2011-11-09 17:56 hawkgogo 阅读(105) 评论(0) 推荐(0) 编辑

博客的第一天

摘要: 发生了很多事情最近,没有办法安心去学习。今天算是和所有这些琐碎的小事儿说声拜拜了,哎。。。对不起,我的小宝贝,没有把你带来到这个世界上。对不起,亲爱的芳芳,没有给你你想要的幸福。 从明天起,开始努力上班,努力学习技术,为了还债,也为了更好的生活。 阅读全文

posted @ 2011-11-09 16:34 hawkgogo 阅读(104) 评论(0) 推荐(0) 编辑