9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] python read problem
@ 2010-08-27  0:18 Michaelian Ennis
  2010-08-27  0:34 ` erik quanstrom
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Michaelian Ennis @ 2010-08-27  0:18 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I've noticed some behaviors I can't explain with python and plan9.  I
am using contrib/installed bichued/python.  Trying to read from a
serial port I would suspect I would have to use f.read() if I want to
be able to catch a specific string where there is no newline.

For instance:
When my firewall is finished booting it end with this output:

Type help or '?' for a list of available commands.
firewall>

"firewall>" being the command prompt.  I would expect to see the same from:

import sys
f = open("/dev/eia0","r")
while (True):
     sys.stdout.write(f.read(1))

Yet this only yields:
Type help or '?' for a list of available commands.

Which makes me think it is still looking for a newline.  Cons exhibits
the expected behavior with the same appliance. That is the prompt is
included.

ian



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-08-27 16:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-27  0:18 [9fans] python read problem Michaelian Ennis
2010-08-27  0:34 ` erik quanstrom
2010-08-27  2:04 ` Federico G. Benavento
2010-08-27 16:31   ` Michaelian Ennis
2010-08-27  9:47 ` Fernan Bolando

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).