开发者

How do I get the username in Python? [duplicate]

开发者 https://www.devze.com 2023-01-28 13:40 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicate: Is there a portable way to get the current username in Python?
This question already has answers here: Closed 12 years ago.

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()
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号