There is an env variable of sorts called EMBEDDED_MODE
, I think, which is used internally to tell whether one is in the notebook.
----------------------------------------------------------------------
| Sage Version 4.6.2.alpha1, Release Date: 2011-01-20 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
**********************************************************************
* *
* Warning: this is a prerelease version, and it may be unstable. *
* *
**********************************************************************
Loading Sage library. Current Mercurial branch is: plotpatches
sage: sage.plot.plot.EMBEDDED_MODE
False
But in the notebook this will give True
.
Can you let us know how this would be useful? One of the things we like to do in Sage is make sure there is *not* a difference, so one can use either method, though things like @interact keep this from being 100% true.
I would like pretty print some results in both notebook and sage prompt. The comand html('
Big Table
') works fine in notebook but not in sage prompt. I will use html(...) in notebook and "print" in sage prompt.Then using this flag should work fine.