python - How to prevent Tkinter and Pyserial from blocking entire program execution -


i writing program involves usage of tkinter (for gui), pyserial (serial communication device), , tweepy. current flow of execution follow:

  1. gui class instantiated (based on tkinter). set of code uses tkinter's standard key binding functions well.
  2. gui class creates non-blocking serial connection internally. used writing, not reading.
  3. program proceeds create tweepy stream instance, , listens tweets.

the gui, , tweepy instances work fine separately. however, when called sequentially, stops @ (2). tweepy initialized after tkinter window closed.

is there way make both tweepy , gui work concurrently (similar multithreading, except objects should have references each other?)

found solution. used threading class.

apparently, had call gui initializer method using thread_1 = threading.thread() , thread_1.start(). other functions did not have run threads.

these might prove helpful has encountered same problem: http://softwareramblings.com/2008/06/running-functions-as-threads-in-python.html


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -