I am trying to make a code in Python where when it runs it will search a directory and its sub-directories for files ending with a file extension ".pdm". I want to note this is not on a personal computer but on a cloud provider. The variable current_dur is just a starting point to narrow down the search. The directory has to go at through at least 3 more folders in its sub-directories.
import os
current_dur = r'\\dmn1.MIR.com\MIRFILE\FS159\FIRSCODB\IR Data Modeling\PIR\IR - Information Report'
for item in os.listdir(current_dur):
if not os.path.isfile(item):
for file in os.listdir(item):
if file.endswith('.pdm'):
print(file)
It returns the error message [WinError 3] The system cannot find the path specified: 'Archive'