所以我有一个正在处理的小项目。当脚本的sql部分运行时,它将结果输出到now()到终端。有什么办法可以阻止这种情况?
my_curson.execute("UPDATE ICA.user SET clockin=now() WHERE uid=%s", (u_scan,))
print "clocked in"
输出lin终端看起来像:
12118311672 Authorised
(datetime.datetime(2019, 3, 6, 18, 50, 16),)
clocked in
编辑
if form == u_scan:
print(u_scan + " Authorised")
my_cursor.execute("SELECT clockin FROM ICA.user WHERE uid=%s", (u_scan,))
isin = my_cursor.fetchall()
for inis in isin:
var1 = isin[0]
if var1 == (None):
my_cursor.execute("UPDATE ICA.user SET clockin=now() WHERE uid=%s", (u_scan,))
print "clocked in"
GPIO.output(12,1)