python get current logged in user code example Example: python get username import os username = os.getlogin()