On Fri, Aug 27, 2010 at 8:18 AM, Michaelian Ennis <[email protected]> wrote:
> 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
>
>

Not sure but might be related.
in C you need do fflush because of the buffered io.

Reply via email to