import os
basepath = os.environ['HOMEDRIVE'] + os.environ['HOMEPATH'] + '\\Downloads\\new\\'
for file in os.listdir(basepath):
path = os.path.join(basepath, file)
if os.path.isdir(path):
print(file)
C:\Users\root\Desktop\cryptographer>python test_2.py
files
videos
C:\Users\root\Desktop\cryptographer>