I have some code to encrypt some strings in Python. Encrypted text is used as a parameter in some urls, but after encrypting, there comes backslashes in string and I cannot use single backslash in urllib2.urlopen.
I cannot replace single backslash with double. For example:
print cipherText
'\t3-@\xab7+\xc7\x93H\xdc\xd1\x13G\xe1\xfb'
print cipherText.replace('\\','\\\\')
'\t3-@\xab7+\xc7\x93H\xdc\xd1\x13G\xe1\xfb'
Also putting r in front of \ in replace statement did not worked.
All I want to do is calling that kind of url:
http://awebsite.me/main?param="\t3-@\xab7+\xc7\x93H\xdc\xd1\x13G\xe1\xfb"
And also this url can be successfully called:
http://awebsite.me/main?param="\\t3-@\\xab7+\\xc7\\x93H\\xdc\\xd1\\x13G\\xe1\\xfb"
Any idea will be appreciated.