0

I am still learning python but got stuck here:

from pathlib import Path
import os
import shutil
p = Path.home()
shutil.copy(p / 'G:\souce.txt', p / 'G:\dest.text')

The error is:

shutil: shutil
Anomalous backslash in string: '\s'. String constant might be missing an r prefix.pylint(anomalous- 
backslash-in-string)
Anomalous backslash in string: '\d'. String constant might be missing an r prefix.pylint(anomalous- 
backslash-in-string)
Module 'shutil' has no 'copy' memberpylint(no-member)

Not able to go for the next step. So any suggestions please.

MVM
  • 3
  • 3

1 Answers1

0

You can just do:

import shutil 
shutil.copy('G:\souce.txt', 'G:\dest.text')
Tomer Shetah
  • 8,413
  • 7
  • 27
  • 35