get user directory python on windows code example Example: python get username windows username = os.getlogin()