Python 检索 RUID?
Python retrieve RUID?
我在 linux 上使用 2.7 之前的 python 版本,想知道如何检索 RUID?
2.7 及更高版本从 os 包中获得了 getresuid,但我似乎找不到 2.6
的等效项
您可以尝试使用 psutil
库。试试 uids
函数:
uids()[source] The real, effective and saved user ids of this process
as a namedtuple. This is the same as os.getresuid()
but can be used
for every process PID.
Availability: UNIX
我在 linux 上使用 2.7 之前的 python 版本,想知道如何检索 RUID?
2.7 及更高版本从 os 包中获得了 getresuid,但我似乎找不到 2.6
的等效项您可以尝试使用 psutil
库。试试 uids
函数:
uids()[source] The real, effective and saved user ids of this process as a namedtuple. This is the same as
os.getresuid()
but can be used for every process PID.Availability: UNIX