摘要:
Hello World作者背景作者是一个使用多种语言开发复杂程序并且拥有十多年经验的软件工程师。作者第一次学习 Python 是在为一个 C++ 库创建绑定的时候。除了 Python,作者曾经用 PHP, Ruby, Smalltalk 甚至 C++ 写过 web 应用。在所有这些中,Python/... 阅读全文
摘要:
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 阅读全文