How do I use the shutil to copy a file?

时间:2017-04-13 14:53:23

标签: python

I am new to python. Can someone explain me why my below code shows error?

import shutil
shutil.copy('E:\\python test\\python\\program\\123.txt', "E:\\python test")

I want to copy the file into another folder, but instead I get the error 'module' object has no attribute 'copy'.

1 个答案:

答案 0 :(得分:0)

您也可以尝试:

import os
os.system ("copy E:\\python test\\python\\program\\123.txt E:\\python test")