Hi,
I'm connecting to a hardware device via telnet. That device is pretty simple in terms of I/O. So I submit a command to it, and after that the device pumps out data one line at a time, once per second. Each line just contains a number.
So my question is this: if I connect to this device using python's telnetlib, how can I fetch data for a fixed period of time (or a fixed number of lines of data)?
I've tried using all the various read_ commands, but they all seem to block indefinitely, apart from read_until, which I can't use as the output can't be used to determine when to stop.
(I'm running python 2.5 under Cygwin, btw).
Any suggestions welcomed!
Edit: Maybe the real question is, should I be using telnetlib at all for this, or should I just use the socket module?
Thanks,
Ben