I have a directory with my .py file and I have another directory where I am writing files to. How can I get a os.listdir of the second directory without using os.chdir?
Edit: Sorry seems like there are 2 parts to my implementation. My current code is this:
files = [f for f in os.listdir(2nd_d) if os.path.isfile(f)]
It currently returns an empty list when there are some files in the directory.