get the user name by python code example Example: python get username import os username = os.getlogin()