On Sun, Jun 1, 2014 at 5:26 PM, Fred Gruber <[email protected]> wrote:
> Hello
> Is it possible to run a process in the background in a sage notebook?
>
> I would like to run a process that takes a long time in the background and
> just print the status in a log file. This way I could continue working on
> the notebook  on other stuff and check the log file once in a while.
>
> How to do this?

In SageMathCloud (https://cloud.sagemath.com) I figured out how to do
this (due to somebody else's request) and implemented it. You put
%fork at the top of a cell, and it will start running as a separate
forked off process in the background:

%fork
sleep(5)
a = 10

When that cell terminates, any global variables it set will get set in
your worksheet, as long as they are pickle-able.  In particular, the
above will set a to 10, after 5 seconds.

This functionality is not available in sagenb.org or the notebook that
comes with Sage, and very likely not with ipython.  It required some
nontrivial special UI support, so wouldn't be trivial to port.


>
> thanks
> Fred
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sage-support.
> For more options, visit https://groups.google.com/d/optout.



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

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to