Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python:运行实时跟踪的GUI_Python_User Interface_Tkinter_Pycharm - Fatal编程技术网

Python:运行实时跟踪的GUI

Python:运行实时跟踪的GUI,python,user-interface,tkinter,pycharm,Python,User Interface,Tkinter,Pycharm,如何将动态时间导入tkinter?import date.time函数将仅从运行该函数的特定时间导入数据。我希望代码运行一次,但仍然像循环一样收集时间数据。您可以创建一个线程,用实际时间上载变量 def This_Thread(): def Start_Acq(): Eth_BG = sched.scheduler(time.time, time.sleep) def Configure(sc): # do your stuf

如何将动态时间导入tkinter?import 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()

是否要模拟时钟?使用
root.after(time,function)
在“time”毫秒后运行“function”。在这个函数中,您可以在之后再次运行
,以获得不阻塞GUI的循环。在该函数中,您可以获取当前时间
date.time
并使用它。在tkinter中的标签中使用
之后的
显示当前时间的示例: