码迷,mamicode.com
首页 > 其他好文 > 详细

os.uname() AttributeError: 'module' object has no attribute 'uname'

时间:2015-01-02 19:54:33      阅读:904      评论:0      收藏:0      [点我收藏+]

标签:

os.uname()

Returns information identifying the current operating system. The return value is an object with five attributes:

  • sysname - operating system name
  • nodename - name of machine on network (implementation-defined)
  • release - operating system release
  • version - operating system version
  • machine - hardware identifier

For backwards compatibility, this object is also iterable, behaving like a five-tuple containing sysnamenodenamereleaseversion, and machine in that order.

Some systems truncate 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()).

Availability: recent flavors of Unix. #只适用于类Unix 系统

Changed in version 3.3: Return type changed from a tuple to a tuple-like object with named attributes.

os.uname() AttributeError: 'module' object has no attribute 'uname'

标签:

原文地址:http://www.cnblogs.com/yumuxu/p/4198685.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!