There are files in nas drive and i want find the files and iterate each file.below is variable i m declaring pathx = path.Path('////NAS01042pn/data/FILESHARE/Jobs/ASM_File/Inbound/NONPROD/AWE_Test')
for path in os.scandir(pathx):
if path.is_file():
print(path.name)
filename = path.name
if('ASM_Test_MEMBERS_' in path.name):
if(True):
fileListCheck = path.name.split('_')
lastString = fileListCheck[-1]
firstLastStringList = lastString.split('.')
but if i do like this i get error as the mentioned path doesnt exist. Also tried below method- #pathx = b'\\NAS01042pn\data\OPTUM_HC_FILESHARE\Talend_Job_Conductor\ASM_Operations\Inbound\NONPROD\Test' but here it stores as bytes and i get error as firstLastStringList cannot be bytes. Any suggestions how to use pathlib for nas drive.