摘要: ulibweb数据库操作安装uliweb后,引用orm。#coding=utf-8from uliweb.orm import *连接数据库连接mysql数据库db = get_connection('mysql://root:root@localhost/mail?charset=utf8')连接sqlite数据库db = get_connection("sqlite:///beijing") #beijing为数据库名表和字段class cnchange(Model): sbus = Field(str) change = Field(str) ... 阅读全文
posted @ 2013-06-22 23:04 bamb00 阅读(428) 评论(0) 推荐(0) 编辑
摘要: python字典操作 Python字典(Dictionary)是一种映射结构的数据类型,由无序的“键-值对”组成。字典的键必须是不可改变的类型,如:字符串,数字,tuple;值可以为任何Python数据类型。1.新建字典>>> dicta = {}>>> type(dicta)2.给字典增加value>>> dicta['name'] = 'nh'>>> print dicta{'name': 'nh'}3.给字典增加元素>>> dicta 阅读全文
posted @ 2013-06-22 11:46 bamb00 阅读(522) 评论(0) 推荐(0) 编辑