Skip to content

Latest commit

 

History

History
30 lines (19 loc) · 538 Bytes

README.md

File metadata and controls

30 lines (19 loc) · 538 Bytes

View on StackOverflow

The easiest way to get the current user name is definitely username.

pip install username

then:

import username
    
print(username())
# your_username

And there is also username-cli, a CLI tool to get your username, just:

pip install username-cli

then:

$ username
# -> your username

Works on Linux, macOS, and Windows