how to know pc username python code example Example: python get username windows username = os.getlogin()