who_care

导航

 

2017年12月5日

摘要: 1.简单的将日志打印到屏幕 import logginglogging.debug('This is debug message')logging.info('This is info message')logging.warning('This is warning message') 屏幕上打印 阅读全文
posted @ 2017-12-05 11:29 who_care 阅读(134) 评论(0) 推荐(0) 编辑
 

2017年11月29日

摘要: uWSGI是一个Web服务器,它实现了WSGI协议、uwsgi、http等协议。Nginx中HttpUwsgiModule的作用是与uWSGI服务器进行交换。WSGI是一种Web服务器网关接口。它是一个Web服务器(如nginx,uWSGI等服务器)与web应用(如用Flask框架写的程序)通信的一 阅读全文
posted @ 2017-11-29 14:11 who_care 阅读(314) 评论(0) 推荐(0) 编辑
 

2017年11月28日

摘要: 1、class属性有空格 (已验证) 当classname 中存在空格的时候,直接使用find_element_by_class_name时,会显示定位失败,此时,需要将classname中的空格替换成英文的点“.”,如下图: 此时如果使用 find_element_by_class_name("l 阅读全文
posted @ 2017-11-28 11:25 who_care 阅读(15652) 评论(0) 推荐(0) 编辑
 

2017年11月15日

摘要: class Tests(object): #定义类 aaa = '10' #定义变量 def test(self): #定义类的方法test b = 20 return b if __name__ == "__main__" : t = Tests() #实例化 snap1 = getattr(t, 阅读全文
posted @ 2017-11-15 17:13 who_care 阅读(745) 评论(0) 推荐(0) 编辑
 

2017年11月7日

摘要: linux为centos6,系统默认安装了python2.6,需要执行的python脚本内容包含标准库之xml.etree.ElementTree 用到库里的一个iter方法是python2.7的新特性,所以需要升级到python2.7 1、升级前的准备: rpm -qa | grep zlib 查 阅读全文
posted @ 2017-11-07 20:02 who_care 阅读(252) 评论(0) 推荐(0) 编辑
 

2017年10月26日

摘要: 1.判断undefined: ? 1 2 3 4 var tmp = undefined; if (typeof(tmp) == "undefined"){ alert("undefined"); } ? 1 2 3 4 var tmp = undefined; if (typeof(tmp) == 阅读全文
posted @ 2017-10-26 17:09 who_care 阅读(195) 评论(0) 推荐(0) 编辑
 

2017年10月25日

摘要: a和b是整数,计算a/b的百分比 a=3 b=7 a=float(a) b=float(b) 保留百分比后2位小数 print "%.2f%%" % (a/b*100) '42.86%' 保留百分比后1位小数 print "%.1f%%" % (a/b*100) '42.9%' 保留百分比 prin 阅读全文
posted @ 2017-10-25 08:42 who_care 阅读(4056) 评论(0) 推荐(0) 编辑
 

2017年10月24日

摘要: 从html中查找元素,之前一般都用find(),查找符合条件的第一个,如下 所以改用select()方法, 阅读全文
posted @ 2017-10-24 20:35 who_care 阅读(14037) 评论(0) 推荐(2) 编辑
 

2017年10月19日

摘要: 阅读全文
posted @ 2017-10-19 20:04 who_care 阅读(301) 评论(0) 推荐(0) 编辑