class TGFC():
def __init__(self, working_time):
self.timer = WFMSR.RECORD_SECONDS
self.archive = []
self.working_time = working_time
self.iterations = working_time/self.timer
self.arch_result = self.our_files_creating()
def WFMSR_add(self, f_index):
self.archive.append(WFMSR(f_index))
def archive_appending(self, prefix='', postfix=''):
for i in enumerate(range(self.iterations)):
threading.Timer(self.timer, self.WFMSR_add('_'+prefix+str(i[0])+postfix))
def our_files_creating(self):
thread.start_new_thread(self.archive_appending, ('', ''))
time.sleep(1.5)
thread.start_new_thread(self.archive_appending, ('', '1'))
...
def main():
our_main_instance = TGFC(10)
if __name__ == '__main__':
main()
>>> import myModule
>>> a = TGFC(10)
Но когда я делаю так:
D:\Python26>python.exe file.py
* recording
* recording
Unhandled exception in thread started by
Error in sys.excepthook:
Original exception was: