摘要:MySQLdb安装失败了,直接使用pymysql,安装了pymysql。 并学习了使用使用pymysql创建数据库和表,并插入数据。 __author__ = 'Administrator' import pymysql try: conn= pymysql.connect(host='localhost', port=3306, user='root', passwd='',cha...
阅读全文
01 2016 档案
摘要:MySQLdb安装失败了,直接使用pymysql,安装了pymysql。 并学习了使用使用pymysql创建数据库和表,并插入数据。 __author__ = 'Administrator' import pymysql try: conn= pymysql.connect(host='localhost', port=3306, user='root', passwd='',cha...
阅读全文
摘要:__author__ = 'Administrator' from tkinter import * import tkinter.messagebox class MainWindow: def buttonListener1(self,event): tkinter.messagebox.showinfo("messagebox","this is button...
阅读全文
摘要:python3.4下遍历文件目录,不需要再特殊处理中文编码 直接使用os.walk来遍历中文目录。 os.walk方法返回的是一个三元 tupple(dirpath, dirnames, filenames), 其中第一个为起始路径, 第二个为起始路径下的文件夹, 第三个是起始路径下的文件. dirpath是一个string,代表目录的路径, dirnames是一个list,包含了dirpath下...
阅读全文
摘要:# -*- coding: UTF-8 -*-import sysimport timeimport os #解决unicode和ASCII码转换的问题reload(sys) #解决unicode和ASCII码转换的问题sys.setdefaultencoding('utf8') #解决unicod
阅读全文
|