0

I am creating one Image Viewer app in python. For that I want to get all the pictures from Pictures folder in windows 10.

As you know that I can get all images from: C:\Users\user_name\Pictures

I can use Path module to get all images files from this folder but that program will only work in my pc because I am typing my user name. User name will be different in different Pcs.

So, I want to know which user is logged in windows 10 and get all the images dynamically which can work in all Pcs. I have no idea how to know the user name. Please help me.

Thanks in advance

Binamra
  • 170
  • 1
  • 8
  • 1
    Does this answer your question? [How to get the home directory in Python?](https://stackoverflow.com/questions/4028904/how-to-get-the-home-directory-in-python) – rikusv Aug 08 '20 at 14:29

1 Answers1

2

You may be able to use pathlib.Path.home() as answered here: https://stackoverflow.com/a/4028943/7793122

rikusv
  • 540
  • 3
  • 10