pythonsql-serveriniconfigparserpymssql

How to use '#' character in INI file?


I am having a trouble with connecting MSSQL to python using Configparser, and one of DB's password has included a character '#'.

Since we don't use escape character " in INI file, then how should I use a character #? (byw, I can't change the password :( )


Solution

  • The # character is used to start a comment in an INI file. Anything after the # on the same line is ignored by the INI parser.