How to find if computation is in a notebook or sage prompt ?
Example of what is needed in sage prompt:
sage: is_sageprompt()
True
Example of what is needed in a notebook:
In an input cell: is_sagenotebook()
The output cell: 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.