I have a problem, which I can't deal with. I'm trying to make my own program to send files to Dropbox, but their system doesn't allow backslashes.
When I want to send path to file like this:
..\Users\TS\Desktop\Program\Nowy dokument tekstowy - Kopia (2).txt
I got error:
ErrorResponse: [400] {u'path': u"Invalid path '/..\\Users\\TS\\Desktop\\Program\\Nowy dokument tekstowy - Kopia (2).txt': character at index 3: backslash not allowed"}
I googled for this (i.e. here and here), searched in Python's os.path docs but it didn't help me.
I mean output for this code:
s = r'..\Users\TS\Desktop\Program\Nowy dokument tekstowy - Kopia (2).txt '
s.replace('\\', '/')
print s
or this:
s = r'..\Users\TS\Desktop\Program\Nowy dokument tekstowy - Kopia (2).txt '
s.replace('\\', '/')
print s
is the same:
..\Users\TS\Desktop\Program\Nowy dokument tekstowy - Kopia (2).txt
I need to deal with relatives paths, not absolutes. Any other idea how to deal with paths like this? Or maybe how to make Dropbox accepts backslashes?
EDIT: I'm using Python2.7