os.getuid()

os.getuid() → uid

Return the current process’s user id.