Possible Duplicate:
Is there a portable way to get the current username in Python?
How can I get the username of the account by which the given script is being execut开发者_开发百科ed?
import getpass
print getpass.getuser()
Possible Duplicate:
Is there a portable way to get the current username in Python?
How can I get the username of the account by which the given script is being execut开发者_开发百科ed?
import getpass
print getpass.getuser()
精彩评论