# !/usr/bin/python3
# -*- coding: utf-8 -*-
# Author: 刘小懒
import pymysql
OPTION = {
"check_sql_data": "0",
"create_tables": "1",
"add_sql_data": "2",
"put_sql_data": "3",
}
def __get_connect():
# 连接数据库
connect = pymysql.Connect(
host=host,
port=port,
user=user,
passwd='password',
db="db_name",
charset='utf8'
)
return connect
def create_tables():
tables = "5"
# 创建数据库表
create_table = """
create table my{}(
id int unsigned primary key auto_increment,
first_name char(10) not null,
last_name char(10) not null,
age int unsigned,
sex