Hi,

see comments below:

On Tue, May 19, 2015 at 2:20 PM, Remco <learningpyt...@hofs-bibo.nl> wrote:
> Hello,

<snip>

> import os
> import shutil
>
> target_dir = r'D:\target\'
> source_dir = r'D:\source\'
> source_file = r'D:\source\list.txt'

you are not using this...

> missing_files = open("missings.txt","w")
>
> for line in open('list.txt'):
> source_file = os.path.normpath(source_dir +line)
> target_file = os.path.normpath(target_dir +line)
> if os.path.exists(target_file):

don't you want to check if the source file is existing?

> shutil.copyfile(source_file,target_file)
> else:
> missing_files.write(line)
> missing_files.close()
> Can someone help my fixing my problem.
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor

HTH,
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to