code: def create_event():
      
      event = windll.kernel32.CreateEventA(
          None,  # Default security attributes.
          BOOL(True),  # Manual reset event.
          BOOL(True),  # Initial state = signaled.
          None  # Unnamed event object.
      )
      if not event:
          raise Exception('event creation failed.')
      return event
docs: Create Win32 event.