Answers for "os.listdir in python"

4

os.listdir in python

#import libs
import os

#set path of file or website on which listdir is to be applied
path='/users/desktop/dummy'

#Print all data in path

for file in os.listdir(path):
  print(file)
Posted by: Guest on June-06-2021
5

os.chdir python

os.chdir("directory name")
Posted by: Guest on November-30-2020
0

list directory in python

from os import listdir

## Prints the current directory as a list (including file types)
print(os.listdir())
Posted by: Guest on April-23-2020

Code answers related to "os.listdir in python"

Python Answers by Framework

Browse Popular Code Answers by Language