Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Is there an existing function detecting the use of the notebook ?

I would like to know whether the user is using the notebook or the command line, in order to behave differently depending on that (for example to output links in html or text). The following works but is a bit hackish:

def is_notebook():
    except NameError:
        return False
        return True

Is there an existing function that does the job in sage ?