I'm trying to write some text to a file in python, however I'm running into a problem with the following line
<ClCompile Include="..\src\node\Node.cpp" />
It seems that python is interpreting the \n in \node as a new line. I need to solve this problem while still maintaining the actual new lines in the file.
EDIT
Upon further investigation it seems that this is being caused by a regex substitution call that I'm making.
A summarized version is a follows:
mainString = mainFile.read()
compileRegex = re.compile(ur'(<ClCompile(.*/>\n)*)')
compileMatch = compileRegex.search(mainString)
compileString = compileMatch.group(1)
tempFileString = tempFile.read()
tempFileString = re.sub(compileRegex, compileString, tempFileString)