python get current user windows code example Example: python get current user windows import os current_user = os.getlogin()