python get directory of fiule code example
Example 1: python list files in current directory
import os
files = os.listdir('.')
print(files)
for file in files:
# do something
Example 2: python os get dir path
from os import getcwd # only import "getcwd" from os
getcwd() # Get the current working directory