What does r mean in python?
"r" is short for "raw". Look up the word meaning "raw, raw". Therefore, it is not difficult to imagine that in front of a Python string, it means "output the string as is", which means that the elements in the string remain unchanged as they originally looked. Python does not escape some symbols.
dos = r"c:\news"
"Like r"c:\news", the string starting with r declares that the thing in the following quotation marks is the original string. Put it inside Any character represents the original meaning of the character.
This method is very useful when setting up the website and website directory structure. When using the original string, there is no need to escape."
Related recommendations: "Python Tutorial"
The above is the detailed content of What does r mean in python. For more information, please follow other related articles on the PHP Chinese website!