@@ -0,0 +1,1074 @@
+# %E7%AC%AC 0002 %E9%A2%98: %E5%B0%86 0001 %E9%A2%98%E7%94%9F%E6%88%90%E7%9A%84 200 %E4%B8%AA%E6%BF%80%E6%B4%BB%E7%A0%81%EF%BC%88%E6%88%96%E8%80%85%E4%BC%98%E6%83%A0%E5%88%B8%EF%BC%89%E4%BF%9D%E5%AD%98%E5%88%B0 MySQL %E5%85%B3%E7%B3%BB%E5%9E%8B%E6%95%B0%E6%8D%AE%E5%BA%93%E4%B8%AD%E3%80%82%0A'''%0A    %E7%9B%B8%E5%85%B3%E6%A8%A1%E5%9D%97/%E5%BA%93 : pymysql%0A        1. http://www.runoob.com/python3/python3-mysql.html%0A'''%0Aimport random, string, time, math, uuid, pymysql%0A%0Achars = string.ascii_letters + string.digits%0A%0Adef gen1():%0A    key = ''.join(random.sample(chars, 10))%0A    #key2 = ''.join(random.choice(chars) for i in range(10))%0A    return key%0A%0Adef gen2():%0A    key = math.modf(time.time())%5B0%5D%0A    return key%0A%0Adef gen3():%0A    return uuid.uuid4()%0A%0Adef dbp():%0A    db = pymysql.connect('localhost', 'root', '1213', 'python')%0A    cursor = db.cursor()%0A    cursor.execute(%22DROP TABLE IF EXISTS CODE%22)%0A    sql = %22%22%22CREATE TABLE CODE (%0A        app_code CHAR(100) NOT NULL%0A    )%22%22%22%0A    cursor.execute(sql)%0A    return db, cursor%0A%0Aif __name__ == '__main__':%0A    db, cursor = dbp()%0A    for i in range(200):%0A        add_code = %22INSERT INTO CODE(app_code) VALUES ('%25s')%22 %25 gen2()%0A        # print(add_code)%0A        try:%0A            cursor.execute(add_code)%0A            db.commit()%0A        except:%0A            db.rollback()%0A    db.close()%0A    print('finish')%0A%0A

Create into_mysql.py