Ask Your Question

Command to get current user of the notebook ?

asked 2014-01-16 04:48:08 -0600

Eric Gaul gravatar image

updated 2014-01-16 04:48:53 -0600

The only command I found :

user = DATA.split('/home/sageservice/nbfiles.sagenb/home/')[0].split('sage_notebook.sagenb/home/')[1].split('/')[0];

parses a path to the current worksheet and returns the user which owns the current worksheet. This name may be different of the current user, in the case of a shared worksheet. The username I am looking for is in fact the one that is displayed on the top line of the screen...

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-01-18 00:52:03 -0600

ndomes gravatar image

updated 2014-01-18 01:15:08 -0600

See docstrings in

For example:

    sage: from sagenb.notebook.user_manager import SimpleUserManager
    sage: U = SimpleUserManager()
    sage: U.create_default_users('password')
    sage: U.user_list()

Isn't this what you want? See also suitable docstrings in

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2014-01-16 04:48:08 -0600

Seen: 282 times

Last updated: Jan 18 '14