随笔分类 -  python

摘要:``` a = { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'standard': { 'format': '%(asctime)s [%(levelname)s] %(name)s: %(message)s' }, },... 阅读全文
posted @ 2019-06-03 00:31 idlewith 阅读(171) 评论(0) 推荐(0)
摘要:``` from PIL import Image from io import BytesIO import win32clipboard def send_msg_to_clip(type_data, msg): win32clipboard.OpenClipboard() win32clipboard.EmptyClipboard() win32clipboard.... 阅读全文
posted @ 2018-04-18 15:48 idlewith 阅读(284) 评论(0) 推荐(0)
摘要:``` #!/usr/bin/env python # _*_ coding: utf-8 _*_ # @Time : 2017/11/1 15:13 # @Author : otfsenter # @File : t123.py import smtplib from email.mime.multipart import MIMEMultipart from email.... 阅读全文
posted @ 2017-11-01 17:13 idlewith 阅读(111) 评论(0) 推荐(0)
摘要:``` !/usr/local/bin/python coding: utf 8 import os import sys import time device = sys.argv[1] index = sys.argv[2] community = '' version = '1' limit 阅读全文
posted @ 2017-10-24 11:55 idlewith 阅读(128) 评论(0) 推荐(0)
摘要:``` #!/usr/bin/env python # _*_ coding: utf-8 _*_ # @Time : 2017/10/19 14:38 # @Author : otfsenter # @File : operation_registry.py import _winreg def delete_sub_key(key0, key1, key2=""): ... 阅读全文
posted @ 2017-10-20 10:11 idlewith 阅读(169) 评论(0) 推荐(0)
摘要:``` #!/usr/bin/env python # _*_ coding: utf-8 _*_ # @Time : 2017/10/20 9:36 # @Author : otfsenter # @File : open_connections.py import ctypes import subprocess import time import win32gui as... 阅读全文
posted @ 2017-10-20 10:09 idlewith 阅读(178) 评论(0) 推荐(0)
摘要:``` 转载 #!/usr/bin/env python #-*-coding=gbk-*- """ 原始数据,用于建立模型 """ #缩水版的courses,实际数据的格式应该为 课程名\t课程简介\t课程详情,并已去除html等干扰因素 courses = [ u'Writing II: Rhetorical Composing', ... 阅读全文
posted @ 2017-10-07 12:46 idlewith 阅读(234) 评论(0) 推荐(0)
摘要:修改python安装目录下Lib\distutils\msvc9compiler.py文件 简单写了一个测试文件(命名为test.py): 在该目录下,再新建一个py文件(命名为setup.py): 阅读全文
posted @ 2017-09-22 15:42 idlewith 阅读(447) 评论(0) 推荐(0)
摘要:``` import win32api from ctypes import windll def click(x, y, button=1, n=1): for i in range(n): flag_press = 2 ** ((2 * button) - 1) flag_release = 2 ** (2 * button) win... 阅读全文
posted @ 2017-09-06 13:32 idlewith 阅读(333) 评论(0) 推荐(0)
摘要:1 1 2 3 General Target Extension: 4 VC++ Directories Include Directories: Library Directories: 2 1 2 阅读全文
posted @ 2017-06-13 09:53 idlewith 阅读(166) 评论(0) 推荐(0)
摘要:``` from win32com.client import constants from win32com.client.gencache import EnsureDispatch as Dispatch outlook = Dispatch("Outlook.Application") mapi = outlook.GetNamespace("MAPI") pri... 阅读全文
posted @ 2017-04-05 10:30 idlewith 阅读(2476) 评论(0) 推荐(0)
摘要:``` # _*_ coding: utf-8 _*_ # @Author : otfsenter import Tkinter as tk import threading import time import ttk import psutil key = psutil.net_io_counters(pernic=True).keys()[0] def seconds(): ... 阅读全文
posted @ 2017-04-01 18:02 idlewith 阅读(135) 评论(0) 推荐(0)
摘要:``` HTTP/1.1 200 OK Server: Apache-Coyote/1.1 X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block Cache-Control: no-cache, no-store, max-age=0, must-revalidate Pragma: no-cache Expires: 0 ... 阅读全文
posted @ 2017-04-01 08:05 idlewith 阅读(232) 评论(0) 推荐(0)
摘要:under set the code: 阅读全文
posted @ 2017-03-31 17:45 idlewith 阅读(120) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2017-03-28 15:34 idlewith 阅读(1) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2017-03-28 15:33 idlewith 阅读(2) 评论(0) 推荐(0)
摘要:``` 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... 阅读全文
posted @ 2017-03-28 15:30 idlewith 阅读(160) 评论(0) 推荐(0)
摘要:``` def send_to_clipboard(clip_type, data): win32clipboard.OpenClipboard() win32clipboard.EmptyClipboard() win32clipboard.SetClipboardData(clip_type, data) win32clipboard.CloseClipboar... 阅读全文
posted @ 2017-03-28 09:50 idlewith 阅读(282) 评论(0) 推荐(0)
摘要:``` 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... 阅读全文
posted @ 2017-03-27 13:28 idlewith 阅读(103) 评论(0) 推荐(0)
摘要:``` On Unix: Access with On Window: Access with from gevent.server import StreamServer def handle(socket, address): socket.send("Hello from a telnet!\ 阅读全文
posted @ 2017-03-26 15:08 idlewith 阅读(154) 评论(0) 推荐(0)