1

I'm creating an IRC bot and I want to be able to constantly receive from my buffer, but at the same time if I type a command into the console I want it to be readily accepted. So far I have a infinite loop that constantly checks the input buffer of the IRC server, but I don't know how I can receive input from the console without freezing everything else.

2

1 Answer 1

3

The best thing to do in this case is to use some sort of UI library that contains an event loop. You poll this event loop for things that happen including keys pressed and mouse clicks.

If you want to do this in a terminal, there is Urwid. If you want to do it as a GUI there are tons of systems available, like:

  • Gnome
  • GTK
  • KDE
  • Tcl/Tk
  • Qt4
  • Kivy

And more of them, and then loads more which aren't cross-platform.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.