Tag: The raw input is the BSP window txt span string that will
Raw string Suppression escape
There are times when we need to open files and so on, then we need to enter the path, especially the window path, mostly using backslashes, this time there will be problems
For example:
handler=open(‘c:\nb123.txt‘,‘w‘)
This time there is a problem, it is open nb123 this text file, but because there is a backslash in front, in the escape is a newline, causing ambiguity
So, we need to change the path to look like this:
Handler=open (<spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string">r'C:\nb123.txt'</span></span></span></span></span>,<spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string">'W'</span></span></span></span></span>) Handler=open (<spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string">'C:\\nb123.txt'</span></span></span></span></span>,<spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string"><spanclass="hljs-string">'W'</span></span></span></span></span>)
This time is legal, use R to suppress escape, or use double backslashes
Python-raw string Suppression escape