#NEWLINE# def copy5( input_path , output_path , complib = 'zlib' , complevel = 0 ) : #NEWLINE# #INDENT# print ( ( 'copying data from %s to %s...' % ( input_path , output_path ) ) ) #NEWLINE# input_file = tables . open_file ( input_path , mode = 'r' ) #NEWLINE# output_file = tables . open_file ( output_path , mode = 'w' ) #NEWLINE# input_table = input_file . root . test #NEWLINE# filter = tables . Filters ( complevel = complevel , complib = complib ) #NEWLINE# output_table = output_file . create_table ( '/' , 'test' , input_table . dtype , filters = filter ) #NEWLINE# chunksize = 10000 #NEWLINE# rowsleft = len ( input_table ) #NEWLINE# start = 0 #NEWLINE# for chunk in range ( ( ( len ( input_table ) / chunksize ) + 1 ) ) : #NEWLINE# #INDENT# stop = ( start + min ( chunksize , rowsleft ) ) #NEWLINE# data = input_table . read ( start , stop ) #NEWLINE# output_table . append ( data ) #NEWLINE# output_table . flush ( ) #NEWLINE# rowsleft -= chunksize #NEWLINE# start = stop #NEWLINE# #UNINDENT# input_file . close ( ) #NEWLINE# output_file . close ( )