When to use os.name, sys.platform, or platform.system?建议 os.name
可能是 'nt'
。
Reliably detect Windows in Python建议 os.name
是 'posix'
。
是 'posix'
还是 'nt'
?
最佳答案
在 Cygwin64 上,
import os; print os.name;
import sys; print sys.platform;
import platform; print platform.system()
产量:
posix
cygwin
CYGWIN_NT-6.1
关于python - Cygwin 上的 os.name 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32612235/