#NEWLINE# def close( self ) : #NEWLINE# #INDENT# ' Close all running subproccesses ' #NEWLINE# self . is_alive = False #NEWLINE# try : #NEWLINE# #INDENT# stats = { #NEWLINE# #INDENT# 'top_offset' : 0 , #NEWLINE# 'default_attribute' : 0 , #NEWLINE# 'cursor_x' : 0 , #NEWLINE# 'cursor_y' : self . cursor_line , #NEWLINE# 'is_alive' : 0 , #NEWLINE# #UNINDENT# } #NEWLINE# self . shm_stats . write ( stats ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# pid_list = ( ctypes . c_int * 10 ) ( ) #NEWLINE# num = ctypes . windll . kernel32 . GetConsoleProcessList ( pid_list , 10 ) #NEWLINE# current_pid = os . getpid ( ) #NEWLINE# for pid in pid_list [ 0 : num ] : #NEWLINE# #INDENT# if ( not pid ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# if ( pid == current_pid ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . close_pid ( pid ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# try : #NEWLINE# #INDENT# self . close_pid ( current_pid ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass