Ask Your Question

Command to get current user of the notebook ?

asked 2014-01-16 11:48:08 +0200

Eric Gaul gravatar image

updated 2014-01-16 11:48:53 +0200

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 07:52:03 +0200

ndomes gravatar image

updated 2014-01-18 08:15:08 +0200

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 11:48:08 +0200

Seen: 532 times

Last updated: Jan 18 '14