On Sat, Sep 19, 2009 at 10:55 AM, Jason Grout <jason-s...@creativetrax.com> wrote: > > Nathann Cohen wrote: >> Excellent !!! >> >> But is there a way to detect whether the user is using the notebook >> ( in which case I use the html.table function ), or if he is using the >> console ( in which case, do we have a similar function for the >> console ? ) >> > > I believe: > > from sage.server.support import EMBEDDED_MODE > if EMBEDDED_MODE: > # notebook stuff > else: > # console stuff > > > That said, I notice using search_src("EMBED") that there are at least > three different EMBEDDED_MODE variables scattered through misc/latex.py, > plot/plot.py, server/support.py. Do we need all of these?
No, we don't. Maybe better than all that would be a function, e.g., is_in_notebook() which returns True if and only if Sage is being used from the notebook. Any ideas for a better name? William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---