03 2017 档案
摘要:under set the code:
阅读全文
摘要:``` exit = QtGui.QAction(QtGui.QIcon(':/log.ico'), 'Exit', self) exit.setShortcut('Ctrl+Q') exit.setStatusTip('Exit Application') self.connect(exit, QtCore.SIGNAL('trig...
阅读全文
摘要:```
def center(self): screen = QtGui.QDesktopWidget().screenGeometry() size = self.geometry() self.move((screen.width()-size.width())/2, (screen.height()-size.height())/2) `...
阅读全文
摘要:``` def closeEvent(self, QCloseEvent): reply = QtGui.QMessageBox.question(self, 'Message', 'Are you sure to quit?', ...
阅读全文
摘要:```
$("input[name='txNotion']").val('ok')
```
阅读全文
摘要:```
def get_pid(pname): process = psutil.process_iter() for pro in process: str_pro = str(pro) pat = re.compile(pname) if pat.search(str_pro): pid = str_pro...
阅读全文
摘要:```
def send_to_clipboard(clip_type, data): win32clipboard.OpenClipboard() win32clipboard.EmptyClipboard() win32clipboard.SetClipboardData(clip_type, data) win32clipboard.CloseClipboar...
阅读全文
摘要:``` coding:utf 8 PyMsgBox A simple, cross platform, pure Python module for JavaScript like message boxes. Al Sweigart al@inventwithpython.com Modified
阅读全文
摘要:```
import os
import fnmatch def get_c_path(): for drive in ('C:\\', 'D:\\'): for dirpath, dirnames, filenames in os.walk(drive): for name in filenames: if fnm...
阅读全文
摘要:``` On Unix: Access with On Window: Access with from gevent.server import StreamServer def handle(socket, address): socket.send("Hello from a telnet!\
阅读全文
摘要:netstat ano |findstr 9000 taskkill /pid 2296 f(让我们果断杀掉它吧!!!) 成功: 已终止 PID 为 2296 的进程
阅读全文
摘要:``` 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...
阅读全文
摘要:```
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...
阅读全文
摘要:```
def setText(aString): clip.OpenClipboard() clip.EmptyClipboard() clip.SetClipboardData(con.CF_UNICODETEXT, aString) clip.CloseClipboard()
```
阅读全文
摘要:``` self.text.bind("", self.selectText) self.text.bind("", self.selectText) ``` ``` def selectText(self, event): self.text.tag_add('sel', '1.0', 'end') return 'break' ```
阅读全文
摘要:```
def to_short_with(long_name): head = long_name.split(' ')[0] tail = long_name.split(' ')[-1] return head[0].lower() + tail.lower()
```
阅读全文
摘要:``` def center_window(self, cont, width, height): screenwidth = cont.winfo_screenwidth() screenheight = cont.winfo_screenheight() size = "%sx%s+%s+%s" % ( width...
阅读全文
摘要:```
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') ...
阅读全文
摘要:``` coding: utf 8 import re import csv import time try: from PySide.QtGui import QApplication from PySide.QtCore import QUrl, QEventLoop, QTimer from
阅读全文
摘要:```
def get_child_windows(parent): if not parent: return hwndChildList = [] gui.EnumChildWindows(parent, lambda hwnd, param: param.append(hwnd), hwndChildList) return hwndChil...
阅读全文
摘要:```
from tkinter import *
from tkinter.ttk import *
import time
import threading
import requests
from bs4 import BeautifulSoup url3 = 'http://stackoverflow.com/questions/31241112/blocking-tkinter-int...
阅读全文
摘要:```
from tkinter import *
from tkinter.ttk import *
import time
import threading class Interface: def __init__(self, master): self.master = master self.browse_button= Button (mast...
阅读全文
摘要:```
# 8 organize your code
import matplotlib
matplotlib.use('TkAgg')
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure
impor...
阅读全文
摘要:coding:utf 8 print each window import win32gui import ctypes EnumWindows = ctypes.windll.user32.EnumWindows EnumWindowsProc = ctypes.WINFUNCTYPE( ctyp
阅读全文
摘要:```
r.withdraw()
``` ```
r.deiconify()
```
阅读全文
摘要:re module version my version Python 3 version Python 2 version
阅读全文
摘要:1 usually 2 specially(modify reg) add.reg remove.reg
阅读全文
摘要:```
python -m timeit -s "li = range(100)" "li.sort(reverse=True)"
```
阅读全文
摘要:body: font family: sans serif div.sphinxsidebar h3 font family: 'Trebuchet MS', sans serif div.sphinxsidebar h4 font family: 'Trebuchet MS', sans seri
阅读全文
摘要:```
# 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(...
阅读全文
摘要:添加以下代码
阅读全文
摘要:```
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(...
阅读全文
摘要:# ```analyze``` ```
result_sid = xml.dom.minidom.parseString(res).getElementsByTagName('email')[0].childNodes[0].nodeValue
```
阅读全文

浙公网安备 33010602011771号