On Sun, Dec 20, 2009 at 8:46 AM, Mike Hansen <[email protected]> wrote:
> Hi Mike,
>
> On Sun, Dec 20, 2009 at 8:42 AM, Mike Witt <[email protected]> wrote:
>> Is there a variable that will tell me whether I've been invoked by a
>> notebook or via the command line?
>
> sage: sage.plot.plot.EMBEDDED_MODE
> False
>
> The above variable will be True when running in the notebook, and
> False when on the command-line.
>
> --Mike
>

That's true, and it was my dumb idea to put the variable in plot.  The
following also works, and to me seems more sensible/canonical:


import sagenb.misc.support
sagenb.misc.support.EMBEDDED_MODE
///
True

sage: import sagenb.misc.support
sage: sagenb.misc.support.EMBEDDED_MODE
False

I need to refine what sagenb.misc.support tells about its environment,
e.g., is it running in a browser without java?  Is sage running on an
iphone via a browser?  Etc.

William

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to