简体   繁体   English

python:你''代表什么?

[英]python: what does u'{' represent?

When I print out a value it has a u in front of it, I think it is some type notation, what is it? 当我打印出一个值时,它前面有一个u ,我认为它是某种类型的符号,它是什么? Where I can find a list of such notations? 我在哪里可以找到这样的符号列表?

It meant UNICODE string literal before Python 3 . 它意味着在Python 3之前的UNICODE字符串文字

Documentation about all these literal adornments can be found there . 有关所有这些文字装饰的文档可以在那里找到。

Unicode Constructors讨论unicode。

That's creating a unicode string. 那就是创建一个unicode字符串。 I'd recommend this section from Dive into Python on the topic 我建议从Dive到Python这一主题的这一部分

There are many advantages to explicitly using unicode, the most common reason for doing so is to force integrity when working with a database. 显式使用unicode有许多优点,这样做的最常见原因是在使用数据库时强制完整性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM