[Tips]Python获取机器用户名的方法

import getpass

print getpass.getuser()

  利用getpass模块

posted @ 2016-07-15 15:56  loghyr  阅读(173)  评论(0)    收藏  举报