01-12-2005, 08:18 AM
0.I think the "#ESCAPE" define is nice. If I have to use "\\" instead of "\" in all the way, I would be crazy.
1.PYTHON use escape chars from C, but it uses r"\n" to mean "\\n" in C. The "r" makes PYTHON source add the supporting for unicode chars some easily: u"some string" is a unicode string.
2.in PYTHON, both single quotation mark and double quotation mark can be used. for example:
and 3 double quotation marks can be used in a block of string:
gives
Just my suggestions, how about mix #ESCAPE define, PYTHON styled strings together? I do think the 2nd PYTHON feature makes programmer less type( why do we use double quotation mark so much? a double quotation mark=a single quotation mark + SHIFT key)
1.PYTHON use escape chars from C, but it uses r"\n" to mean "\\n" in C. The "r" makes PYTHON source add the supporting for unicode chars some easily: u"some string" is a unicode string.
2.in PYTHON, both single quotation mark and double quotation mark can be used. for example:
Code:
print 'hello "world"' --hello "world"
print "hello 'world'" --hello 'world'
Code:
print """
2nd line <----yes, the 1st line is blank here
'something'
""" #this ends the block
Code:
2nd line <----yes, the 1st line is blank here
'something'
Just my suggestions, how about mix #ESCAPE define, PYTHON styled strings together? I do think the 2nd PYTHON feature makes programmer less type( why do we use double quotation mark so much? a double quotation mark=a single quotation mark + SHIFT key)