摘要: ``` import gevent from gevent import monkey monkey.patch_all() import requests import time import os import pprint urls = ['http://www.baidu.com', 'http://www.cnblogs.cn', 'http://ww... 阅读全文
posted @ 2017-03-26 14:27 idlewith 阅读(189) 评论(0) 推荐(0)
摘要: ``` from pywinauto import application import psutil import re def getPid(pName): process = psutil.process_iter() for pro in process : str_pro = str(pro) pat = re.compile(pNam... 阅读全文
posted @ 2017-03-25 18:28 idlewith 阅读(135) 评论(0) 推荐(0)
摘要: ``` def setText(aString): clip.OpenClipboard() clip.EmptyClipboard() clip.SetClipboardData(con.CF_UNICODETEXT, aString) clip.CloseClipboard() ``` 阅读全文
posted @ 2017-03-22 10:07 idlewith 阅读(199) 评论(0) 推荐(0)
摘要: ``` self.text.bind("", self.selectText) self.text.bind("", self.selectText) ``` ``` def selectText(self, event): self.text.tag_add('sel', '1.0', 'end') return 'break' ``` 阅读全文
posted @ 2017-03-22 10:06 idlewith 阅读(424) 评论(0) 推荐(1)
摘要: ``` def to_short_with(long_name): head = long_name.split(' ')[0] tail = long_name.split(' ')[-1] return head[0].lower() + tail.lower() ``` 阅读全文
posted @ 2017-03-22 10:06 idlewith 阅读(125) 评论(0) 推荐(0)
摘要: ``` def center_window(self, cont, width, height): screenwidth = cont.winfo_screenwidth() screenheight = cont.winfo_screenheight() size = "%sx%s+%s+%s" % ( width... 阅读全文
posted @ 2017-03-22 10:01 idlewith 阅读(273) 评论(0) 推荐(0)
该文被密码保护。 阅读全文
posted @ 2017-03-19 17:45 idlewith 阅读(3) 评论(0) 推荐(0)
摘要: ``` def parse_from(html): tree = lxml.html.fromstring(html) data = {} for e in tree.cssselect('form input'): if e.get('name'): data[e.get('name')] = e.get('value') ... 阅读全文
posted @ 2017-03-17 16:02 idlewith 阅读(135) 评论(0) 推荐(0)
摘要: ``` coding: utf 8 import re import csv import time try: from PySide.QtGui import QApplication from PySide.QtCore import QUrl, QEventLoop, QTimer from 阅读全文
posted @ 2017-03-17 15:41 idlewith 阅读(429) 评论(0) 推荐(0)
摘要: ``` def get_child_windows(parent): if not parent: return hwndChildList = [] gui.EnumChildWindows(parent, lambda hwnd, param: param.append(hwnd), hwndChildList) return hwndChil... 阅读全文
posted @ 2017-03-17 09:24 idlewith 阅读(360) 评论(0) 推荐(0)