2

Using Python 2.7, how would I make an event loop that I can run my program inside? My idea is that the script will run, and the event loop will detect the press of a certain key (q in this case), that will do the same thing as Keyboard Interupt, just slightly prettier.

I've seen this question, but wasn't sure how to apply it.

Also, like the OP of the linked question, I'd like to do this without any external modules/packages (if possible).

I can post my program code if you need it, but I don't think it's relevant in this case.

Community
  • 1
  • 1
evamvid
  • 831
  • 6
  • 18
  • 40
  • See this answer for an example using the curses library: http://stackoverflow.com/questions/8718561/python-3-how-to-input-data-without-pressing-return-in-osx – bwbrowning Mar 12 '14 at 01:33
  • @bwbrowning Thanks but I'm on Windows (for this script) and don't have curses... – evamvid Mar 12 '14 at 01:52

0 Answers0