def ttylog_close(logfile, stamp):
 with open(logfile, 'ab') as f:
  (sec, usec) = (int(stamp), int((1000000 * (stamp - int(stamp)))))
  f.write(struct.pack('<iLiiLL', 2, 0, 0, 0, sec, usec))

def ttylog_close ( logfile , stamp ) : with open ( logfile , 'ab' ) as f : ( sec , usec ) = ( int ( stamp ) , int ( ( 1000000 * ( stamp - int ( stamp ) ) ) ) ) f . write ( struct . pack ( '<iLiiLL' , 2 , 0 , 0 , 0 , sec , usec ) )
close tty log .