Catching user switching and getting current active user from root on linux

Tim Golden mail at timgolden.me.uk
Wed Dec 1 03:48:45 EST 2010


On 30/11/2010 22:47, mpnordland wrote:
> I have situation where I need to be able to get the current active
> user, and catch user switching eg user1 locks screen, leaves computer,
> user2 comes, and logs on.
> basically, when there is any type of user switch my script needs to
> know.

If it's Windows you're on, have a look at this:

   http://timgolden.me.uk/python/win32_how_do_i/track-session-events.html

TJG



More information about the Python-list mailing list