Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6382537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:32:05+00:00 2026-05-25T02:32:05+00:00

I am trying to display real-time text in Tkinter after a Button command calls

  • 0

I am trying to display real-time text in Tkinter after a Button command calls a function. The function should display a “timestamp” when PycURL receives “HTTP/1.1 200 OK”. The function POSTs energy data to a server every 2 minutes.

Pseudocode, a basic example, and/or general discussion should get me headed in the right direction. I have got the energy data POSTing OK. Now I need to get the GUI working.

Thanks – Brad

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:32:06+00:00Added an answer on May 25, 2026 at 2:32 am

    Found the answer in the book “Programming Python” by Mark Lutz. The following code is adapted from the book using info from Threads and Queues!

        import thread, Queue, time, random, poster
        from Tkinter import *
    
        dataQueue = Queue.Queue()
    
        def status(t):
            try:
                data = dataQueue.get(block=False)
            except Queue.Empty:
                pass
            else:
                t.delete('0', END)
                t.insert('0', '%s\n' % str(data))
            t.after(250, lambda: status(t))
    
        def makethread():
            thread.start_new_thread(poster.poster, (1,dataQueue))    
    
        if __name__ == '__main__':
            root = Tk()
            root.geometry("240x45")
            t = Entry(root)
            t.pack(side=TOP, fill=X)
            Button(root, text='Start Epoch Display',
                    command=makethread).pack(side=BOTTOM, fill=X)
            status(t)
            root.mainloop()
    

    In another file called poster

        import random, time
    
        def poster(id,que):
            while True:
                delay=random.uniform(0.1, .11)
                time.sleep(delay)
                que.put(' epoch=%f, delay=%f' % (time.time(), delay))
    

    This worked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very new to MATLAB and I was trying to display a real time
I'm trying to display a UIImage in real-time coming from the camera, and it
I am trying to display audio at real time using, analoginput, this is the
We are trying to develop a real-time display system in safety critical domain. (All
Trying to display current time with PHP (using this ): $date = date('m/d/Y h:i:s
I've been trying to display text using a Quartz context, but no matter what
I am trying to make a non interactive display for a real estate shop
I'm trying to implement a real-time updating search bar which updates a TreeView when
I'm trying to make a very simple iphone app that displays the real-time camera
I am trying to display the real value of ¼ and ” , but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.