How to make python 3 understand double backslash? [duplicate]

  python, python-3.x, windows

So, as SO keeps suggesting me, I do not want to replace double backslashes, I want python to understand them.

I need to copy files from a windows distant directory to my local machine.

For example, a "equivalent" (even if not) in shell (with windows paths):

cp directorysubdirectoryfile ./mylocalfile

But python does not even understand double backslashes in strings:

source = "dirsubdirfile"
print(source)

$ python __main__.py 
__main__.py:1: DeprecationWarning: invalid escape sequence s
  source = "dirsubdirfile"
dirsubdir
           ile

Is Python able to understand windows paths (with double backslashes) in order to perform file copies ?

Source: Windows Questions

LEAVE A COMMENT