你能找到RUID吗?

2024-03-29 11:01:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我在linux上使用的是2.7之前的python版本,我想知道如何检索RUID?你知道吗

2.7和更高版本已经从操作系统包中获得了getresuid,但是我似乎找不到与2.6相当的版本


Tags: 版本linuxruidgetresuid
1条回答
网友
1楼 · 发布于 2024-03-29 11:01:59

您可以尝试使用psutil库。尝试^{}函数:

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

相关问题 更多 >