2016年1月8日
摘要: 一、安装python-ldap找不到lber.h的解决方法sudo apt-get install libldap2-dev libsasl2-dev二、示例# coding=utf8import ldapsearchname='zzz'username='xxx'password='xxx'uid... 阅读全文
posted @ 2016-01-08 12:50 perel 阅读(557) 评论(0) 推荐(0) 编辑
  2015年12月23日
摘要: firefox代理 driver:https://github.com/mozilla/geckodriver/releases chrome代理 driver:http://chromedriver.storage.googleapis.com/index.html https://sites.g 阅读全文
posted @ 2015-12-23 11:45 perel 阅读(1097) 评论(0) 推荐(0) 编辑
  2015年12月10日
摘要: 一、property用法property(fget=None, fset=None, fdel=None, doc=None) -> property attributefget is a function to be used for getting an attribute value, and... 阅读全文
posted @ 2015-12-10 14:17 perel 阅读(326) 评论(0) 推荐(0) 编辑
  2015年12月5日
摘要: http://effbot.org/imagingbook/ 一、安装 pip install PIL --allow-external PIL --allow-unverified PIL 注:新版pip不支持--allow-external了,但可直接安装 pip install pillow 阅读全文
posted @ 2015-12-05 23:15 perel 阅读(311) 评论(0) 推荐(0) 编辑
  2015年11月9日
摘要: 1 import pynotify,sys2 if not pynotify.init('a'):3 sys.exit(1) 4 n=pynotify.Notification('title','info','file:///pathto/111.png')5 n.show()效果类似not... 阅读全文
posted @ 2015-11-09 16:23 perel 阅读(564) 评论(0) 推荐(0) 编辑
  2015年10月12日
摘要: 一、数字计算echo $[3600*24] --只能计算整数echo $((3600*4)) --只能计算整数expr 3600 \* 24 --注意空格,*要加\,只能计算整数echo 'scale=4;36*2400;1+2/3'|bcecho ''|awk '{print 3600*24... 阅读全文
posted @ 2015-10-12 16:21 perel 阅读(148) 评论(0) 推荐(0) 编辑
  2015年8月24日
摘要: 1、参考相应c程序1 s='s=%s%s%s;print s%s(chr(39),s,chr(39),chr(37))';print s%(chr(39),s,chr(39),chr(37))http://www.nyx.net/%7Egthompso/self_pyth.txt 阅读全文
posted @ 2015-08-24 23:35 perel 阅读(516) 评论(0) 推荐(0) 编辑
  2015年8月9日
摘要: 1 import Tkinter2 top = Tkinter.Tk()3 top.mainloop()Tkinter的部件:Tkinter的提供各种控件,如按钮,标签和文本框,一个GUI应用程序中使用。这些控件通常被称为部件.目前有15种Tkinter的部件。我们提出这些部件以及一个简短的介绍,在... 阅读全文
posted @ 2015-08-09 00:04 perel 阅读(969) 评论(0) 推荐(0) 编辑
  2015年8月8日
摘要: import repattern=re.compile(fmt)m=pattern.match(str)或m=re.match(fmt,str)返回m.group() 所有匹配m.groups() 等价于[group(1),group(2),...],返回括号括起的分组>>> match = r... 阅读全文
posted @ 2015-08-08 16:24 perel 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 一、datetime 1、date date.today() 2、time 3、datetime datetime.datetime.now()/today() datetime.datetime.strftime(fmt) 转换为字符串 datetime.datetime.strptime(fmt 阅读全文
posted @ 2015-08-08 15:18 perel 阅读(342) 评论(0) 推荐(0) 编辑