Answers for "python read folder within folder"

14

get list of folders in directory python

import os 
my_list = os.listdir('My_directory')
Posted by: Guest on June-08-2020
1

python get files in directory

from pathlib import Path
for txt_path in Path("/path/folder/directory").glob("*.txt"):
  print(txt_path)
Posted by: Guest on November-30-2020

Python Answers by Framework

Browse Popular Code Answers by Language