this was supposed to be a simple script
import shutil
files = os.listdir(\"C:\\\\\")
for efile in files:
shutil.copy(efile, \"D:\\\\\")
<
You need to use Unicode to access filenames which aren't in the ACP (ANSI codepage) of the Windows system you're running on. To do that, make sure you name directories as Unicode:
import shutil
files = os.listdir(u"C:\\")
for efile in files:
shutil.copy(efile, u"D:\\")
Passing a Unicode string to os.listdir
will make it return results as Unicode strings rather than encoding them.
Don't forget that os.listdir
won't include path, so you probably actually want something like:
shutil.copy(u"C:\\" + efile, u"D:\\")
See also http://docs.python.org/howto/unicode.html#unicode-filenames.