0

I want to get the name of a user automatically to locate files such as f'users/{username}/desktop/file is there a way I can do this?

1 Answers1

1

You could use the getpass module:

getpass.getuser()

This works for both Unix and Windows.

Dolev Pearl
  • 264
  • 2
  • 8