Home  >  Article  >  Backend Development  >  What does r mean in python

What does r mean in python

藏色散人
藏色散人Original
2019-06-22 13:51:3111550browse

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.

What does r mean in python

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to use %f in pythonNext article:How to use %f in python