def _copy_lines_between_files(in_, fout, n=None, skip=0, mode='a', terminal_line=''):
 mtimesleep()
 if isinstance(in_, str):
  fin = open(in_, 'r')
 else:
  fin = in_
 for i in xrange(skip):
  fin.readline()
 i = 0
 lines = []
 while ((n is None) or (i < n)):
  l = fin.readline()
  if ((terminal_line is not None) and (l == terminal_line)):
   break
  lines.append(l)
  i += 1
 if isinstance(fout, str):
  fout = open(fout, mode)
 fout.write('\n'.join(lines))
 fout.flush()
 if isinstance(in_, str):
  fin.close()
 time.sleep(Utils.DEFAULT_SHORT_INTERVAL)
 return fout

def _copy_lines_between_files ( in_ , fout , n = None , skip = 0 , mode = 'a' , terminal_line = '' ) : mtimesleep ( ) if isinstance ( in_ , str ) : fin = open ( in_ , 'r' ) else : fin = in_ for i in xrange ( skip ) : fin . readline ( ) i = 0 lines = [ ] while ( ( n is None ) or ( i < n ) ) : l = fin . readline ( ) if ( ( terminal_line is not None ) and ( l == terminal_line ) ) : break lines . append ( l ) i += 1 if isinstance ( fout , str ) : fout = open ( fout , mode ) fout . write ( '\n' . join ( lines ) ) fout . flush ( ) if isinstance ( in_ , str ) : fin . close ( ) time . sleep ( Utils . DEFAULT_SHORT_INTERVAL ) return fout
copy lines from one file to another returns open fout .