Python Windows 错误

Python errors on Windows

所以这段代码是在 Linux 上写的,现在我尝试在 Windows 上 运行 它,但我遇到了这样的错误,我该怎么办?

它只适用于 Unix。 https://docs.python.org/3/library/os.html#os.uname

不确定 sys.platform 是否符合您的需求。