如何将动态时间导入tkinter?导入 date.time 函数将仅导入运行该特定时间的数据。我希望代码运行一次,但仍像循环一样收集时间数据。
您可以创建一个线程,用于上传包含实际时间的变量。
def This_Thread():
def Start_Acq():
Eth_BG = sched.scheduler(time.time, time.sleep)
def Configure(sc):
# do your stuff, for example:
now = datetime.datetime.now()
dt_string = now.strftime("%d/%m/%Y; %H:%M:%S")
DSP_BG.enter(Insert_Here_Your_Rate, Insert_Here_Your_Priority, Configure, (DSP_BG,))
DSP_BG.run()
Ethernet_thread = threading.Thread(target=Start_Acq)
Ethernet_thread.start()