摘要: Hello World作者背景作者是一个使用多种语言开发复杂程序并且拥有十多年经验的软件工程师。作者第一次学习 Python 是在为一个 C++ 库创建绑定的时候。除了 Python,作者曾经用 PHP, Ruby, Smalltalk 甚至 C++ 写过 web 应用。在所有这些中,Python/... 阅读全文
posted @ 2014-05-31 13:40 CodeBank 阅读(609) 评论(0) 推荐(0) 编辑
摘要: python包含子目录中的模块方法比较简单,关键是能够在sys.path里面找到通向模块文件的路径。下面将具体介绍几种常用情况:(1)主程序与模块程序在同一目录下:如下面程序结构:`-- src |-- mod1.py `-- test1.py 若在程序test1.py中导入模块m... 阅读全文
posted @ 2014-04-18 22:41 CodeBank 阅读(205) 评论(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 阅读(765) 评论(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 阅读(220) 评论(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 阅读(558) 评论(0) 推荐(0) 编辑