Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to see directory from os module

import pathlib

# define the path
currentDirectory = pathlib.Path('.')

# define the pattern
currentPattern = "*.py"

for currentFile in currentDirectory.glob(currentPattern):
    print(currentFile)
Source by stackabuse.com #
 
PREVIOUS NEXT
Tagged: #directory #os #module
ADD COMMENT
Topic
Name
6+7 =