I have a python dictionary that holds connection details like so:
x = {
'myserver' : {
'DSN': 'servername',
'DATABASE': 'mydatabase',
'UID': 'myusername',
'PWD': 'my\\password'
}
}
I expected the PWD value to be my\password but I get my\\password instead.
As a string on its own works i.e.
pwd = 'my\\password'
# returns my\password
So I tried this (but still doesn't work):
pwd = 'my\\password'
x = {
'myserver' : {
'DSN': 'servername',
'DATABASE': 'mydatabase',
'UID': 'myusername',
'PWD': pwd
}
}
Also tried four backslashes \\\\, tried just one backslash \ (got an error), tried putting r in front of string value and a combination of them, still nothing...
Essentially expecting the output of the dictionary to display/hold/point to my\password and not my\\password