def get_user():
'''
Get the current user
'''
if HAS_PWD:
return pwd.getpwuid(os.geteuid()).pw_name
else:
user_name = win32api.GetUserNameEx(win32api.NameSamCompatible)
if user_name[-1] == '$' and win32api.GetUserName() == 'SYSTEM':
# Make the system account easier to identify.
user_name = 'SYSTEM'
return user_name
评论列表
文章目录