上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页
摘要: 最近做一些数据库调研的工作,目标是实现影像更快的入库、出库、查询,并实现并行访问等操作。将结果总结成一个mysqlImg类。关于mongodb的图像存储,参见http://www.cnblogs.com/bigbigtree/p/3242483.html关于mysql&python的问题和mysql... 阅读全文
posted @ 2013-08-11 21:16 bigbigtree 阅读(6512) 评论(0) 推荐(0)
摘要: Class cursor.MySQLCursorBuffered该类从Class cursor.MySQLCursorBuffered继承,如果需要,可以在执行完SQL语句后自动缓冲结果集合。import mysql.connectorcnx = mysql.connector.connect()# Only this particular cursor will buffer resultscnx.cursor(buffered=True)# All cursors will be buffering by defaultcnx2 = mysql.connector.connect(buff 阅读全文
posted @ 2013-08-09 13:57 bigbigtree 阅读(2216) 评论(0) 推荐(0)
摘要: Class cursor.MySQLCursor具体方法和属性如下:Constructor cursor.MySQLCursorMethod MySQLCursor.callproc(procname, args=())Method MySQLCursor.close()Method MySQLCursor.execute(operation, params=None, multi=False)Method MySQLCursor.executemany(operation, seq_params)Method MySQLCursor.fetchall()Method MySQLCursor. 阅读全文
posted @ 2013-08-09 10:06 bigbigtree 阅读(5816) 评论(0) 推荐(0)
摘要: 首先对于数据库的基本操作要有一定基础,其次了解Python的基础语法。建议先阅读MysqL中文教程http://doc.mysql.cn/mysql5/refman-5.1-zh.html-chapter/和Python基础教程。一、python连接Mysql连接MySQL的方法有多种,如MySQLdb http://sourceforge.net/projects/mysql-python/但是该项目并不支持python3。现在Mysql官方已经提供了python的连接接口Connector/Python,有安装方法和文档。Connector/Python安装地址:http://dev.my 阅读全文
posted @ 2013-08-08 20:59 bigbigtree 阅读(1733) 评论(0) 推荐(0)
摘要: 连接mysql数据库:cnx = mysql.connector.connect(user='joe', database='test') Connector/Python参数列表Argument NameDefaultDescriptionuser(username*)The user name used to authenticate with the MySQL server.password(passwd*)The password to authenticate the user with the MySQL server.database(db*)T 阅读全文
posted @ 2013-08-08 11:05 bigbigtree 阅读(545) 评论(0) 推荐(0)
摘要: BLOB是一个二进制大对象,可以容纳可变数量的数据。有4种BLOB类型:TINYBLOB、BLOB、MEDIUMBLOB和LONGBLOB。它们只是可容纳值的最大长度不同。A binary large object that can hold a variable amount of binary data. The sorting and comparison of the values for these objects is performed in case-sensitive manner.TINYBLOBA binary large object column with a max 阅读全文
posted @ 2013-08-07 21:50 bigbigtree 阅读(17575) 评论(0) 推荐(1)
摘要: 最近做一些数据库调研的工作,目标是实现影像更快的入库、出库、查询,并实现并行访问等操作。将结果总结成一个mongoImg类,也算是小结吧。 1 ''' 2 Created on 2013-8-6 3 class mongoInsert 4 @author: tree 5 ''' 6 __metacl... 阅读全文
posted @ 2013-08-07 09:59 bigbigtree 阅读(10014) 评论(6) 推荐(0)
摘要: 将一个py脚本从Centos转到win运行,出错如下:UnicodeDecodeError: 'gbk' codec can't decode byte 0xff in position 0: illegal multibyte sequence虽然明白是编码的问题,网络上decode()什么的,貌似不适用python3。后来发现使用字节方式打开可以。出错函数如下:gridfs.GridFS.put()函数。其中调用了读写操作If you want raw bytes then you need to open it in binary mode.pipe = open 阅读全文
posted @ 2013-08-05 16:19 bigbigtree 阅读(19154) 评论(3) 推荐(0)
摘要: 混淆了 python2 里边的 str 和 unicode 数据类型。1.对需要 str->unicode 的代码,可以在前边写上import sysreload(sys)sys.setdefaultencoding('utf8')把 str 编码由 ascii 改为 utf8 (或 gb18030)2.python3 区分了 unicode str 和 byte arrary,并且默认编码不再是 ascii 阅读全文
posted @ 2013-08-02 14:45 bigbigtree 阅读(24505) 评论(0) 推荐(0)
摘要: eclipse emacs 插件http://www.mulgasoft.com/emacspluseclipse字体设置:一、把字体设置为Courier New操作步骤:打开Elcipse,点击菜单栏上的“Windows”——点击“Preferences”——点击“Genneral”——点击“Appearance”——点击“Colors and Font”——在右侧框展开“Basic”文件夹--双击“Text Font”——在弹出窗选择“Courier New”(注:这里可能找不到“Courier New”,点击字体选择框左下角的“显示更多字体”链接来打开设置字体的控制面板,找到“Couri 阅读全文
posted @ 2013-08-01 16:41 bigbigtree 阅读(387) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 19 下一页