Answers for "printing names of all files in folder python"

1

python list all files in directory

import os
 arr = os.listdir()
 print(arr)
 
 >>> ['$RECYCLE.BIN', 'work.txt', '3ebooks.txt', 'documents']
Posted by: Guest on April-15-2021
2

get list of files in directory python

import os
path = '/folder1/folder2/'
files = os.listdir(path)
Posted by: Guest on January-20-2021

Code answers related to "printing names of all files in folder python"

Python Answers by Framework

Browse Popular Code Answers by Language