WorksheetProcess question

0 views
Skip to first unread message

Pat LeSmithe

unread,
Oct 14, 2009, 3:30:36 AM10/14/09
to sage-n...@googlegroups.com
If I run

sage: from sagenb.interfaces.expect import
WorksheetProcess_ExpectImplementation
sage: wp = WorksheetProcess_ExpectImplementation()
sage: wp.execute("open('/tmp/foo.txt', 'w').write('foooOOO!'); print
'barRRR!'")
sage: wp.output_status()

Output Status:
output: 'barRRR!'
filenames: []
done: True


I see /tmp/foo.txt on disk only after the last command. Is this the
expected behavior? Or should the parent process call wp.output_status()
after each wp.execute(string), to start executing string?

My apologies for my ignorance.

William Stein

unread,
Oct 14, 2009, 1:11:30 PM10/14/09
to sage-n...@googlegroups.com
On Wed, Oct 14, 2009 at 12:30 AM, Pat LeSmithe <qed...@gmail.com> wrote:
>
> If I run
>
> sage: from sagenb.interfaces.expect import
> WorksheetProcess_ExpectImplementation
> sage: wp = WorksheetProcess_ExpectImplementation()
> sage: wp.execute("open('/tmp/foo.txt', 'w').write('foooOOO!'); print
> 'barRRR!'")
> sage: wp.output_status()
>
> Output Status:
>        output: 'barRRR!'
>        filenames: []
>        done: True
>
>
> I see /tmp/foo.txt on disk only after the last command.  Is this the
> expected behavior?

No. It sounds like a bug. It won't be a problem for sagenb as is,
since the server does pole for output regularly.

>  Or should the parent process call wp.output_status()
> after each wp.execute(string), to start executing string?

Maybe the *input* buffer has to be flushed explicitly?

William

>
> My apologies for my ignorance.
>
>

--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org

Reply all
Reply to author
Forward
0 new messages