MCPcopy Create free account
hub / github.com/ActiveState/code / makeThread

Class makeThread

recipes/Python/578875_Analog_Clock/recipe-578875.py:87–107  ·  view source on GitHub ↗

Creates a thread.

Source from the content-addressed store, hash-verified

85## Class for creating a new thread.
86#
87class makeThread (Thread):
88 """Creates a thread."""
89
90 ## Constructor.
91 # @param func function to run on this thread.
92 #
93 def __init__ (self,func):
94 Thread.__init__(self)
95 self.__action = func
96 self.debug = False
97
98 ## Destructor.
99 #
100 def __del__ (self):
101 if ( self.debug ): print ("Thread end")
102
103 ## Starts this thread.
104 #
105 def run (self):
106 if ( self.debug ): print ("Thread begin")
107 self.__action()
108
109## Class for drawing a simple analog clock.
110# The backgroung image may be changed by pressing key 'i'.

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected