This works: from subprocess import call call('reboot')