me trataron:¿Cómo obtengo el nombre del sistema operativo de manera amigable usando Python 2.5?
print os.name
Y la salida me dieron fue:
:nt
Sin embargo, quiero salida más como "Windows 98", o "Linux".
Después de sugerencias en esta pregunta, también probé:
import os
print os.name
import platform
print platform.system()
print platform.release()
Y mi salida fue:
Traceback (most recent call last):
File "C:/Documents and Settings/BIU1LR/Desktop/python_programs/program/platform.py", line 3, in <module>
import platform
File "C:/Documents and Settings/BIU1LR/Desktop/python_programs/program\platform.py", line 4, in <module>
print platform.system()
AttributeError: 'module' object has no attribute 'system'
estoy usando Python 2.5.2. ¿Qué estoy haciendo mal?
nombre del sistema operativo del servidor? O el nombre del SO del cliente? (En caso de que esté haciendo un desarrollo web ...) –
vea también http://stackoverflow.com/questions/1854/python-how-do-i-tell-what-os-im-running-on – NicDumZ
import sys print (sys.version) nos da el resultado para que sepamos con qué estamos tratando –