0

The program is based on the owner we have to return the absolute path of files from the path specified, the path specified can be from any directory. This program has to be done in python using windows.

  • Does this answer your question? [Howto determine file owner on windows using python without pywin32](https://stackoverflow.com/questions/8086412/howto-determine-file-owner-on-windows-using-python-without-pywin32) – dboy May 25 '20 at 05:53
  • @dboy OP is not talking about file ownership – medic17 May 25 '20 at 05:59

2 Answers2

0

I think this might be what you are looking for

import os
print(os.getcwd())

This prints out the current working directory, which includes the name of the user which I'm guessing is what you are after.

Mandera
  • 2,647
  • 3
  • 21
  • 26
0

If you just want the username

import os
os.getlogin()
medic17
  • 415
  • 5
  • 16