I am trying to develop a script or tool to tell about how long each user occupies the computer, in order to manage and balance the resource. As for the user name, Python provides clean way to get it by os.getlogin(). However, I searched and could not find a neat Python API method to get the login and logoff time of that specific user. For Windows, I have to "query user" and this does not work for windows XP. And for Linux, I have to admit I am not good at it. Do you guys know a cross-platform and Python API way to do that?.
Thanks a lot! Di
Windows Solution (should work on xp)
you can use
to determine which OS you are in and use a separate method for each OS, for example
to answer your question re network users