def write_events(filename, event_list):
 check_fname(filename, 'events', ('.eve', '-eve.fif', '-eve.fif.gz', '-eve.lst', '-eve.txt'))
 ext = splitext(filename)[1].lower()
 if ((ext == '.fif') or (ext == '.gz')):
  fid = start_file(filename)
  start_block(fid, FIFF.FIFFB_MNE_EVENTS)
  write_int(fid, FIFF.FIFF_MNE_EVENT_LIST, event_list.T)
  end_block(fid, FIFF.FIFFB_MNE_EVENTS)
  end_file(fid)
 else:
  f = open(filename, 'w')
  for e in event_list:
   f.write(('%6d %6d %3d\n' % tuple(e)))
  f.close()

def write_events ( filename , event_list ) : check_fname ( filename , 'events' , ( '.eve' , '-eve.fif' , '-eve.fif.gz' , '-eve.lst' , '-eve.txt' ) ) ext = splitext ( filename ) [ 1 ] . lower ( ) if ( ( ext == '.fif' ) or ( ext == '.gz' ) ) : fid = start_file ( filename ) start_block ( fid , FIFF . FIFFB_MNE_EVENTS ) write_int ( fid , FIFF . FIFF_MNE_EVENT_LIST , event_list . T ) end_block ( fid , FIFF . FIFFB_MNE_EVENTS ) end_file ( fid ) else : f = open ( filename , 'w' ) for e in event_list : f . write ( ( '%6d %6d %3d\n' % tuple ( e ) ) ) f . close ( )
write events to file .