Good afternoon, I ran into such a problem. You need to execute a command from the Python script:
copy \\example.com\lvl0\lvl2\lvl3 Windows I am writing this code:
path = r'copy \\example.com\lvl0\lvl2\lvl3 Windows' path = path.split() p2 = Popen(path, stdout=PIPE) As a result, the path variable is:
['copy', '\\\\example.com\\lvl0\\lvl2\\lvl3', 'Windows'] And the Popen command does not work as it should, because it accepts an incorrect path with duplicated slashes. Tell me, please, how to pass the path in these cases?
Tried to solve this problem like this:
path = [] path.append[r'copy'] path.append[r'\\example.com\lvl0\lvl2\lvl3'] path.append[r'Windows'] p2 = Popen(path, stdout=PIPE)
'\\'is one character, not two. - Pavel Mayorovstdout=PIPEif you do not read fromp2.stdout- jfs