sldb/test.py

21 lines
333 B
Python

#coding:utf-8
'''
Created on 2016年10月21日
@author: StarLee
'''
import MySQLdb
from __builtin__ import str
conn = MySQLdb.connect(host="localhost",user="starlee",passwd="1234",db="sldb",charset='utf8' )
cursor = conn.cursor()
l = [1,2,3]
m = {item:item for item in l}
print m
print m[1]
print m[1]
print m[1]
m[1] = 2
print m