AutoFramework/main.py

34 lines
871 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import pymysql.cursors
import re
conn = pymysql.connect(
host='127.0.0.1',
port=3306,
user='root',
password='root',
database='db',
charset='utf8',
autocommit=True,
connect_timeout=10,
cursorclass=pymysql.cursors.DictCursor,
client_flag=pymysql.constants.CLIENT.MULTI_STATEMENTS
)
curr = conn.cursor()
try:
resu = curr.execute('insert into user (username,email,phone,password) values ("刘周星驰","10003@example.com","13512310003","0123456789abcdef0123456789abcdef");')
# resu = curr.execute('select * from user;')
# resu = curr.execute('select username from user where uid like "1%";')
print('res',resu)
except:
pass
conn.commit()
print(curr.rowcount)
print(curr.fetchall())
i = "4"
match i:
case 1:
print("是1")
case "2"|"3":
print('又是1')
case _:
print("其它")