上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 29 下一页
摘要: 基于win7 + python3.4 import ctypes import sys '''Windows CMD命令行颜色''' # 句柄号 STD_INPUT_HANDLE = -10 STD_OUTPUT_HANDLE= -11 STD_ERROR_HANDLE = -12 # 前景色 FO 阅读全文
posted @ 2016-03-05 14:13 罗兵 阅读(3347) 评论(1) 推荐(0) 编辑
摘要: import ctypes # 方式一 ctypes.windll.user32.MessageBoxA(None, 'message', 'title', 0) # 方式二 ctypes.WinDLL('user32.dll').MessageBoxA(None, 'message', 'titl 阅读全文
posted @ 2016-03-05 13:05 罗兵 阅读(4687) 评论(0) 推荐(0) 编辑
摘要: 基于win7 + python3.4 原文是py2环境,而我的环境是py3,所以对原代码做了修改:decode(), encode() 2016-06-16修改: 阅读全文
posted @ 2016-03-04 20:53 罗兵 阅读(37470) 评论(8) 推荐(5) 编辑
摘要: b = b"Hello, world!" # bytes object s = "Hello, world!" # str object print('str --> bytes') print(bytes(s, encoding="utf8")) print(str.encode(s)) # 默认 阅读全文
posted @ 2016-03-04 20:14 罗兵 阅读(28582) 评论(0) 推荐(0) 编辑
摘要: from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5.QtGui import * from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as 阅读全文
posted @ 2016-03-02 15:56 罗兵 阅读(719) 评论(0) 推荐(0) 编辑
摘要: 基于64位 win7 系统 先到 http://www.lfd.uci.edu/~gohlke/pythonlibs/ 下载四个 wheel 文件: 1. lxml-3.4.4-cp27-none-win_amd64.whl 2. Twisted-15.5.0-cp27-none-win_amd64 阅读全文
posted @ 2016-02-26 10:09 罗兵 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 定义项目 # -*- coding: utf-8 -*- # items.py import scrapy class LianxiCnblogsItem(scrapy.Item): # define the fields for your item here like: # name = scra 阅读全文
posted @ 2016-02-25 08:42 罗兵 阅读(453) 评论(0) 推荐(0) 编辑
摘要: pywin32 安装后 import win32api 出现ImportError: DLL load failed: 找不到指定的模块 解决方法: 拷贝 C:\Python26\Lib\site-packages\pywin32_system32\* 至 C:\Windows\System32 阅读全文
posted @ 2016-02-24 06:31 罗兵 阅读(4229) 评论(1) 推荐(0) 编辑
摘要: SQLite3日期与时间,常见函数 import sqlite3 #con = sqlite3.connect('example.db') con = sqlite3.connect(":memory:") c = con.cursor() # Create table c.execute('''C 阅读全文
posted @ 2016-02-22 01:41 罗兵 阅读(8126) 评论(0) 推荐(0) 编辑
摘要: 一、sqlite3日期数据类型,默认用datetime解析(根据stackflow) 使用时注意三点: 1. 创建表时,字段 DT 的类型为 date 2. 插入数据时,DT字段直接为 str 类型 3. DT字段的str ,年月日必须为 xxxx-xx-xx 格式,如 2016-01-01,不能是 阅读全文
posted @ 2016-02-22 00:56 罗兵 阅读(21475) 评论(0) 推荐(1) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 29 下一页