[Mono-list] Process.StandardOutput.Readline() hangs on Mono but not on .NET
Weeble
clockworksaint at gmail.com
Mon Feb 4 22:56:16 UTC 2013
On 4 Feb 2013 22:41, "jrjr" <jresnick at gmail.com> wrote:
>
> Hi,
>
> I'm trying to port a program from .NET/windows to Mono/linux, but I'm
> running into some trouble with the System.Diagnostics.Process class.
[...]
>
> and the python script is this:
>
> #!/usr/bin/python
> line = raw_input()
> while len(line) > 0:
> print("Hello " + line)
> line = raw_input()
>
> This all works fine on .NET/Windows but on Mono/Linux it hangs on the call
> to p.StandardOutput.ReadLine(). Any idea what's going on here?
This looks like an issue with buffered Python output. Try flushing Python's
stdout before calling raw_input, or disabling buffering. See here:
http://stackoverflow.com/questions/107705/python-output-buffering
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20130204/b9467aa4/attachment.html>
More information about the Mono-list
mailing list