logout from linux using python code example Example: logout from linux using python pkill -KILL -u {username}