更新时间:2023-12-05 09:31:10
Mark的答案是必经之路,这就是/proc文件系统在那里的原因.要复制/粘贴一些内容:
Mark's answer is the way to go, after all, that's why the /proc file system is there. For something a little more copy/pasteable:
>>> import os.path
>>> os.path.exists("/proc/0")
False
>>> os.path.exists("/proc/12")
True