发布时间:2013-01-24 17:10:36
python 以逗号分割,忽略引号内的逗号加posix=True 和不加posix=True 有区别前两个是加和不加posix=True的对比,最后一个例子是以空格分割的语句的例子lex.quotes = '"' 去掉效果一样import shlexstr=shlex.shlex("ab,'cdsfd,sfsd',ewewq,5654",posix=True)str.whitespace=','str.whitesapce_s.........【阅读全文】
发布时间:2012-12-12 14:23:21
原文:http://hi.baidu.com/litertiger/blog/item/506cb5debaa3d55bccbf1aed.html import MySQLdb db_user = "tiger" db_pw = "tiger" db = MySQLdb.connect(host="localhost", user=db_user, passwd=db_pw ,db="finaltldw",charset="gb2312") c = db.cursor() c.execute("""select id, name from NODES""") i=0; fo......【阅读全文】