import os
from shutil import copyfile
change to my working directory
os.chdir('Z:/')
confirm my current working directory
print (os.getcwd())
this is the file source I would like to copy
infile = open("NFO.nfo","r")
this reads into "file_nfo" all the "file names" with NFO extension that I am trying to copy using the "shutil.copy" to copy SourceFile > DestinationFile
for f in os.listdir ():
file_name, file_ext = os.path.splitext(f)
file_nfo = file_name+'.nfo'
print (file_nfo)
shutil.copyfile (infile, file_nfo)
copyfile (infile, outfile) - this is not working - any help is appreciated - I would like to thank you in advance for taking the time to read this.
this closes the SourceFile
infile.close()