04 2014 档案
摘要:python包含子目录中的模块方法比较简单,关键是能够在sys.path里面找到通向模块文件的路径。下面将具体介绍几种常用情况:(1)主程序与模块程序在同一目录下:如下面程序结构:`-- src |-- mod1.py `-- test1.py 若在程序test1.py中导入模块m...
阅读全文
摘要:# -*- coding: utf-8 -*-import osimport sysimport MySQLdbconn = MySQLdb.connect(host='127.0.0.1', user='root', ...
阅读全文
摘要:# -*- coding: utf-8 -*-import MySQLdbconn = MySQLdb.connect(host='127.0.0.1', user='root', passwd='root', ...
阅读全文
摘要:# -*- 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
阅读全文
浙公网安备 33010602011771号