标签: python
可能重复: Is there a portable way to get the current username in Python?
如何获取执行给定脚本的帐户的用户名?
答案 0 :(得分:75)
import getpass print getpass.getuser()