我想使用shutil.copyfile
复制文件src = "C:\Users\Abdur\Documents\NetBeansProjects\Exam System\dist\Exam_System.war"
dest = "C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.14\webapps"
if os.path.isdir(dest):
dst = os.path.join(dest, os.path.basename(src))
shutil.copyfile(src, dest)
但它提供以下例外:
IOError: [Errno 13] Permission denied: 'C:\\Program Files\\Apache Software Foundation\\Apache Tomcat 7.0.14\\webapps\\Exam_System.war'