Ask Your Question

Revision history [back]

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 ?