nonblocking

Python/Erlang: What's the difference between Twisted, Stackless, Greenlet, Eventlet, Coroutines? Are they similar to Erlang processes?

Python/Erlang: What's the difference between Twisted, Stackless, Greenlet, Eventlet, Coroutines? Are they similar to Erlang processes? Question: My incomplete understanding is that Twisted, Stackless, Greenlet, Eventlet, Coroutines all make use of async network IO and userland threads that are very lightweight and quick to switch. But I’m not sure what are the differences between them. …

Total answers: 3

When and how to use Tornado? When is it useless?

When and how to use Tornado? When is it useless? Question: Ok, Tornado is non-blocking and quite fast and it can handle a lot of standing requests easily. But I guess it’s not a silver bullet and if we just blindly run Django-based or any other site with Tornado it won’t give any performance boost. …

Total answers: 2

A non-blocking read on a subprocess.PIPE in Python

A non-blocking read on a subprocess.PIPE in Python Question: I’m using the subprocess module to start a subprocess and connect to its output stream (standard output). I want to be able to execute non-blocking reads on its standard output. Is there a way to make .readline non-blocking or to check if there is data on …

Total answers: 30

Polling the keyboard (detect a keypress) in python

Polling the keyboard (detect a keypress) in python Question: How can I poll the keyboard from a console python app? Specifically, I would like to do something akin to this in the midst of a lot of other I/O activities (socket selects, serial port access, etc.): while True: # doing amazing pythonic embedded stuff # …

Total answers: 12