Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8745185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:57:56+00:00 2026-06-13T11:57:56+00:00

Possible Duplicate: Event loop implementation for Python 3? I am trying to implement an

  • 0

Possible Duplicate:
Event loop implementation for Python 3?

I am trying to implement an event loop in python2.7. I would like to be able to trigger events based on a time event and as a result of another action taking place.

I understand I can make use of select to do something similar to this.

Is this the right way forwards or is there a better way which I am missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:57:57+00:00Added an answer on June 13, 2026 at 11:57 am

    An event loop is a loop which handles / deals with events.

    An event is something that occurs in the system where some code parts might be interested in.

    At the beginning, all components register for events, and after that, an init event is fired:

    I am just providing raw code here:

    listeners = [component1, component2, component3]
    eventqueue.add(InitEvent())
    while True:
        event = eventqueue.pop()
        for listener in listeners:
            listener.handle_event(event)
    

    How an eventqueue is implemented and what the Event() class hierarchy looks like is left as an exercise for the reader. Take care about using threading.(R)Locks etc. for the .pop() method.

    Additionally, you could have separate listener lists for each event type. An event could thus be “fired” by just calling it (or its .fire() method) and have a mechanism to identify all its own and parent’s listeners in order to inform them about the event.

    In any case, the listeners then can decide on their own what to do with and according to the event.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How would you implement a basic event-loop? Not really a language-specific question.
Possible Duplicate: Create event handler for OnScroll for web browser control I would like
Possible Duplicate: Trigger an event with Prototype example, 3 onclick events in javascript/prototype. How
Possible Duplicate: Need to cancel click/mouseup events when double-click event detected Preventing double-click of
Possible Duplicate: VB.NET RemoveHandler & Anonymous Methods If I add an event handler like
Possible Duplicate: The current element as its Event function param Would this work <script
Possible Duplicate: Event handlers inside a Javascript loop - need a closure? I have
Possible Duplicate: Throttle event calls in jQuery I like the .change() functionality of jQuery,
Possible Duplicate: jQuery event to trigger action when a div is made visible How
Possible Duplicate: Event handlers inside a Javascript loop - need a closure? I am

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.