Answers for "getting contents of a directory in Python"

8

get directory of file python

import os 
dir_path = os.path.dirname(os.path.realpath(__file__))
Posted by: Guest on April-03-2020
0

python program to print the contents of a directory using os module

import os
li = os.listdir(".")
print(li)
Posted by: Guest on February-24-2021

Code answers related to "getting contents of a directory in Python"

Python Answers by Framework

Browse Popular Code Answers by Language