这些可能有用。我不知道它们作为服务运行时的行为。它们不是便携式的,但那就是 os.name 和 if 声明是为了。
os.name
if
win32api.GetUserName() win32api.GetUserNameEx(...)
见: http://timgolden.me.uk/python/win32_how_do_i/get-the-owner-of-a-file.html