2021
02-24
02-24
python自动生成sql语句的脚本
描述:工作中在数据库中创建表时,当字段很多时,比较麻烦,开发一个工具,可在excel中写好字段英文名和中文名,然后通过py生成脚本或直接在库中生成表脚本:importtkinterfromtkinterimport*importtkinter.messageboxfromtkinterimportscrolledtextimportxlrdimportpymysqlimportos#从excel中获取字段项,组合建表语句defget_create_sql(dir_path,file_name):try:#打开xls文件#excel_path="%s%s"%(dir_pat...
继续阅读 >