English 中文(简体)
2. 草原体分配
原标题:python raw string assignment

档案中载有下列内容:

(?i:sys.user_catalog)

在阅读这段话时,我想,价值是原始扼杀(替罪羊),意思是,记忆中,应当有一条线。

r (?i:sys.user_catalog) 

而不是

(?i:sys.user_catalog)

那些在被传至诸如bject子等深层时就逃。

例如,如果我说是这样的话,就有了bject子。

Table(column=r (?i:sys.user_catalog) )

如果我表示,我会取得预期结果。

Table(column= (?i:sys.user_catalog) )

我没有。

因此,在我不采用声明/声明方式(例如<条码>a=r string)时,我基本上可以通过一项粗略的阐述,而扼杀已经记忆中。

最佳回答

原始扼杀物只用于“灰色源法”;所有被宣布为“原始胎体”的扼杀物都“被转用”到“复合时段”中添加了必要的脱节顺序(如(第2条)两种不同的窒息/编码):

>>> r""
 \b 
>>> "Hello"
 Hello  
>>> u"Hello"
u Hello 

如果你从档案中读过脚,就会被正确地逃脱。

(假设test.txt 包含(?i:sys_catalog)):

f = open("test.txt").read()
print f
print repr(f)

产出:

(?i:sys.user_catalog)
 (?i:\bsys\.user_catalog\b) 
问题回答

你们可以在你正在使用窒息的任何地方使用 raw。 在你身处逃生地时,游泳只是一种方便用户的方法。

第二个案件由于<代码>而没有工作。 因此,你需要使用另一个<代码>。 第二种情况是,请<代码>(?i:/bsys/user_catalog/b)。 记忆中,由于ASCII或Unicode被储存,如果是原始地貌,它就没有任何变化。

你们正想到这种错误做法。 只有一个“草体”,只有“体力”。 在引文前撰写的<代码>r仅能说明如何解释以下文字。





相关问题
Simple JAVA: Password Verifier problem

I have a simple problem that says: A password for xyz corporation is supposed to be 6 characters long and made up of a combination of letters and digits. Write a program fragment to read in a string ...

Case insensitive comparison of strings in shell script

The == operator is used to compare two strings in shell script. However, I want to compare two strings ignoring case, how can it be done? Is there any standard command for this?

Trying to split by two delimiters and it doesn t work - C

I wrote below code to readin line by line from stdin ex. city=Boston;city=New York;city=Chicago and then split each line by ; delimiter and print each record. Then in yet another loop I try to ...

String initialization with pair of iterators

I m trying to initialize string with iterators and something like this works: ifstream fin("tmp.txt"); istream_iterator<char> in_i(fin), eos; //here eos is 1 over the end string s(in_i, ...

break a string in parts

I have a string "pc1|pc2|pc3|" I want to get each word on different line like: pc1 pc2 pc3 I need to do this in C#... any suggestions??

Quick padding of a string in Delphi

I was trying to speed up a certain routine in an application, and my profiler, AQTime, identified one method in particular as a bottleneck. The method has been with us for years, and is part of a "...

热门标签