num = re.sub("\D", "", num)
print(num)
数据库插入数据(时间函数)
def fun_Insert_to_Siemensdb(pkcode,mrname,floorid,floorname):
cursor = conn.cursor()
dt = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
sql = "INSERT INTO Tbxxx (sxxId,sName,sxx,nxx,tCreate) VALUES (%s,%s,%s,%s,%s)"
val = (pkcode,mrname,floorid,floorname,dt)
cursor.execute(sql, val)
conn.commit()
网友评论