随笔分类 -  python

摘要:netstat ano |findstr 9000 taskkill /pid 2296 f(让我们果断杀掉它吧!!!) 成功: 已终止 PID 为 2296 的进程 阅读全文
posted @ 2017-03-26 15:01 idlewith 阅读(225) 评论(0) 推荐(0)
摘要:``` 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 阅读(188) 评论(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 阅读(133) 评论(0) 推荐(0)
摘要:``` def setText(aString): clip.OpenClipboard() clip.EmptyClipboard() clip.SetClipboardData(con.CF_UNICODETEXT, aString) clip.CloseClipboard() ``` 阅读全文
posted @ 2017-03-22 10:07 idlewith 阅读(198) 评论(0) 推荐(0)
摘要:``` 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 阅读(122) 评论(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 阅读(133) 评论(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 阅读(358) 评论(0) 推荐(0)
摘要:coding:utf 8 print each window import win32gui import ctypes EnumWindows = ctypes.windll.user32.EnumWindows EnumWindowsProc = ctypes.WINFUNCTYPE( ctyp 阅读全文
posted @ 2017-03-14 13:31 idlewith 阅读(570) 评论(0) 推荐(0)
摘要:``` python -m timeit -s "li = range(100)" "li.sort(reverse=True)" ``` 阅读全文
posted @ 2017-03-12 23:40 idlewith 阅读(145) 评论(0) 推荐(0)
摘要:body: font family: sans serif div.sphinxsidebar h3 font family: 'Trebuchet MS', sans serif div.sphinxsidebar h4 font family: 'Trebuchet MS', sans seri 阅读全文
posted @ 2017-03-12 23:08 idlewith 阅读(98) 评论(0) 推荐(0)
摘要:``` # server.py # Fib microservice from socket import * from fib import fib from threading import Thread #from concurrent.futures import ProcessPoolExecutor as Pool ##pool = Pool(4) def fib_server(... 阅读全文
posted @ 2017-03-12 16:26 idlewith 阅读(121) 评论(0) 推荐(0)
摘要:代码如下 阅读全文
posted @ 2017-03-09 23:27 idlewith 阅读(98) 评论(0) 推荐(0)
摘要:添加以下代码 阅读全文
posted @ 2017-03-09 19:15 idlewith 阅读(1009) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2017-03-08 20:42 idlewith 阅读(2) 评论(0) 推荐(0)
摘要:``` from gevent import monkey; monkey.patch_all() import gevent from information_from_espace import Espace_info def get_email(jobNumber): t = Espace_info(jobNumber) print t.get_espace_info(... 阅读全文
posted @ 2017-03-07 13:23 idlewith 阅读(112) 评论(0) 推荐(0)
摘要:# ```analyze``` ``` result_sid = xml.dom.minidom.parseString(res).getElementsByTagName('email')[0].childNodes[0].nodeValue ``` 阅读全文
posted @ 2017-03-07 09:58 idlewith 阅读(93) 评论(0) 推荐(0)
摘要:* ```function``` ``` def modify_time(time_str): ''' set time of kwargs :param time_str: like '2017-02-16' :return: dict ''' kwargs = {'earliest_time':'', \ 'lat... 阅读全文
posted @ 2017-02-28 11:20 idlewith 阅读(138) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2017-02-22 01:05 idlewith 阅读(0) 评论(0) 推荐(0)
摘要:import linecache def eachlineof(filename): with open(filename, 'r') as f: for cnt, line in enumerate(f): a = str(cnt) + ',' + line.strip('\n') yield a 阅读全文
posted @ 2017-02-21 23:44 idlewith 阅读(117) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2017-02-21 19:23 idlewith 阅读(0) 评论(0) 推荐(0)