04 2014 档案

摘要:python包含子目录中的模块方法比较简单,关键是能够在sys.path里面找到通向模块文件的路径。下面将具体介绍几种常用情况:(1)主程序与模块程序在同一目录下:如下面程序结构:`-- src |-- mod1.py `-- test1.py 若在程序test1.py中导入模块m... 阅读全文
posted @ 2014-04-18 22:41 CodeBank 阅读(226) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*-import osimport sysimport MySQLdbconn = MySQLdb.connect(host='127.0.0.1', user='root', ... 阅读全文
posted @ 2014-04-14 17:34 CodeBank 阅读(795) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*-import MySQLdbconn = MySQLdb.connect(host='127.0.0.1', user='root', passwd='root', ... 阅读全文
posted @ 2014-04-13 17:39 CodeBank 阅读(230) 评论(0) 推荐(0)
摘要:# -*- coding: utf-8 -*-import MySQLdbconn = MySQLdb.connect(host='127.0.0.1',user='root',passwd='root',db='cb',port=3306,charset='utf8')cur = conn.cursor()goods = cur.execute("select goods_name from es_goods where goods_id=59")esGoods = cur.fetchmany 阅读全文
posted @ 2014-04-12 23:27 CodeBank 阅读(577) 评论(0) 推荐(0)