摘要: /root Linux超级权限用户root的家目录。/home 如果我们建立一个用户,用户名是"xx",那么在/home目录下就有一个对应的/home/xx路径,用来存放用户的主目录。 root是管理员账号,root文件夹是管理员的主目录,它的配置文件还有root的一些别的东西放在这里。而home是 阅读全文
posted @ 2016-12-27 18:36 guohuino2 阅读(361) 评论(0) 推荐(0) 编辑
摘要: 1 python下载安装 python早已安装,不再多说。因为开发使用的python2.7,所以同样使用2.7 2 打开Powershell, 输入python -m pip install selenium 。 提示: Requirement already satisfied (use --up 阅读全文
posted @ 2016-12-27 11:38 guohuino2 阅读(450) 评论(0) 推荐(0) 编辑
摘要: 报错: Traceback (most recent call last): File "C:\Users\william\Desktop\nova xml\New folder\download_xml.py", line 95, in <module> downloadXml(isExists, 阅读全文
posted @ 2016-12-22 15:02 guohuino2 阅读(13988) 评论(0) 推荐(0) 编辑
摘要: mysql数据库中有的字段是NULL, 有的字段是空白 写Python脚本,fetchall()得到结果,也是不同。 NULL对应的是None, 空白对应的是‘’ (None, '') 所以根据结果进行判断,也要不同。 阅读全文
posted @ 2016-11-25 14:11 guohuino2 阅读(9929) 评论(0) 推荐(0) 编辑
摘要: 一般的读取文件的方法: with open(file_path, "r") as f: print f.read() 或者 with open(file_path,"r") as f: for line in f.readlines(): print line read()是一次性把文件内容以字符串 阅读全文
posted @ 2016-11-08 15:22 guohuino2 阅读(8178) 评论(0) 推荐(0) 编辑
摘要: time 模块,理解容易 import time time_start = time.time() time_end = time.time() time_use = time_end - time_start 或者 time_start =time.clock() time_use = time. 阅读全文
posted @ 2016-11-08 14:40 guohuino2 阅读(1973) 评论(0) 推荐(0) 编辑
摘要: fd = open("C:\Users\william\Desktop\dup_file - Copy (3).txt","r")for i in fd: print i 耗时 25.6074296742s fd = open("C:\Users\william\Desktop\dup_file - 阅读全文
posted @ 2016-11-08 14:20 guohuino2 阅读(955) 评论(0) 推荐(0) 编辑
摘要: fd = open("C:\Users\william\Desktop\dup_file - Copy (2).txt")for i in xrange(0,len(fd.readlines())): print i print fd.readline(), 在研究xrange(0,10000)循环 阅读全文
posted @ 2016-11-08 14:11 guohuino2 阅读(489) 评论(0) 推荐(0) 编辑
摘要: 文件中共有4行内容。 fd = open("C:\Users\william\Desktop\dup_file - Copy (2).txt")for i in xrange(0,5): print type(fd.readline()) print fd.readline() print " " 阅读全文
posted @ 2016-11-08 14:07 guohuino2 阅读(2709) 评论(0) 推荐(0) 编辑
摘要: range(start,stop,step) range(0,8) >>print range(0,8) [0,1,2,3,4,5,6,7] range()返回一个数字列表。 start 默认0,stop不可缺少,step默认为1 xrange(start,stop,step) xrange(0,8 阅读全文
posted @ 2016-11-08 13:33 guohuino2 阅读(235) 评论(0) 推荐(0) 编辑