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 3495908
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T12:11:03+00:00 2026-05-18T12:11:03+00:00

I am developing a Python 2.7.1 / Tkinter 8.4 app on Windows XP that

  • 0

I am developing a Python 2.7.1 / Tkinter 8.4 app on Windows XP that checks several lines of input from a RS-232 port. However, if no input arrives it will sit in a loop for ever.

I am trying to implement an ‘Abandon Test’ button on the GUI but because the main thread is busy waiting for input it doesn’t appear to every check if a button has been pressed.
I have tried update_idletasks() and time.sleep(1) with no success.

Any suggestions?

  • 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-18T12:11:04+00:00Added an answer on May 18, 2026 at 12:11 pm

    Tk is single-threaded, so if the main thread is busy the GUI will freeze. One solution is to use a separate thread to do the reading, so when the read blocks your main thread can continue. When you get a line of input you can push it on a queue which is monitored by the main thread.

    The other way is to figure out how to do a non-blocking read on your serial port. If there is data, read it. If not, return to the main event loop. You then need to configure the event loop to poll your port every few hundred milliseconds or so, depending on your performance needs.

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

Sidebar

Related Questions

I am developing a piece of software in Python that will be distributed to
What are some toolkits for developing 2D games in Python? An option that I
What is the best way to start developing Windows Mobile Professional applications in Python?
I'm developing a Django app, and I'm trying to use Python's logging module for
I am developing a Java application using Google App Engine that depends on a
We're developing a Python web service and a client web site in parallel. When
I am developing a GPL-licensed application in Python and need to know if the
I am developing my stuff in python. In this process I encountered a situation
I attempted to install pymongo to my Windows box with Python 3.2 through easy_install
I´m developing a very memory-consuming app and want to use the largeHeap-Tag, which should

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.