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

import getpass

print getpass.getuser()

  利用getpass模块

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