Editing Python Desk Top Applications

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 143: Line 143:
 
=== Helper Thread in Smart Terminal ===
 
=== Helper Thread in Smart Terminal ===
 
Smart Terminal is fairly typical:  HelperThread in smart_terminal_helper.py  This class provides the support for a second thread of execution that does not block the main thread being run by Tinker.  I call the two threads the GUI Thread (gt) and the Helper Thread ( ht ).  It can get confusing keeping track of which method is running in which thread, I sometimes annotate them with gt and ht.  The helper thread is started by running HelperThread.run() which pretty much just runs a polling task in HelperThread.polling().  HelperThread.polling() is an infinite loop, it uses sleep to set the polling rate.  When used with the green house processing module, it may call a function there that is its own infinite loop.  There are a lot of details here, I should write some more about it.
 
Smart Terminal is fairly typical:  HelperThread in smart_terminal_helper.py  This class provides the support for a second thread of execution that does not block the main thread being run by Tinker.  I call the two threads the GUI Thread (gt) and the Helper Thread ( ht ).  It can get confusing keeping track of which method is running in which thread, I sometimes annotate them with gt and ht.  The helper thread is started by running HelperThread.run() which pretty much just runs a polling task in HelperThread.polling().  HelperThread.polling() is an infinite loop, it uses sleep to set the polling rate.  When used with the green house processing module, it may call a function there that is its own infinite loop.  There are a lot of details here, I should write some more about it.
 
=== Polling ===
 
Both threads have method that perform polling for events often for items in their queue that may have been sent from the other thread.  Info on a similar app in [[Python Smart Terminal Technical Details]].  Polling is also used in some single threaded applications.  Parameters for polling are set in parameters.py
 
  
 
== Parameters ==
 
== Parameters ==

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)