И будете не правы, потому что: os.uname() Return a 5-tuple containing information identifying the current operating system. The tuple contains 5 strings: (sysname, nodename, release, version, machine).
Some systems truncate the nodename to 8 characters or to the leading component; a better way to get the hostname is socket.gethostname() or even socket.gethostbyaddr(socket.gethostname()).
Скайп таки взломали! http://skype-open-source.blogspot.com/
ReplyDeleteА я при чем? :)
ReplyDeleteimport os
ReplyDeletehostname = os.uname()[1]
И будете не правы, потому что:
ReplyDeleteos.uname()
Return a 5-tuple containing information identifying the current operating system. The tuple contains 5 strings: (sysname, nodename, release, version, machine).
Some systems truncate the nodename to 8 characters or to the leading component; a better way to get the hostname is socket.gethostname() or even socket.gethostbyaddr(socket.gethostname()).
Источник: http://docs.python.org/library/os.html
ибо print os.uname()[1]
ReplyDeleteили более кроссплатформенно
import platform; print platform.node()