Python判斷當前使用者是否是root

Dus發表於2015-02-04

import os
if os.geteuid() != 0:
print "This program must be run as root. Aborting."
sys.exit(1)

相關文章