how to get the logged in user for windows python code example Example: python get current user windows import os current_user = os.getlogin()