[Python-de] Aus r'\012' einen Zeilenumbruch ohne if erzeugen
Georg Mischler
schorsch at schorsch.com
Mon Feb 10 14:00:48 EST 2003
Fritz Cizmarov wrote:
> >>> erg.replace(r'\012', '\n')
Ich hoffe, das ist ein Scherz?
>>> '\n' is '\012'
1
>>> '\n' == '\012'
1
>>> '\n'
'\n'
>>> '\012'
'\n'
>>> print '\n'
>>> print '\012'
>>>
Das \012 ist schlicht die numerische Repraesentation des
<newline> characters, also mit '\n' identisch.
Ehrlich gesagt verstehe ich deswegen weder das urspruengliche
Problem noch die vermeintliche Loesung so ganz...
-schorsch
--
Georg Mischler -- simulations developer -- schorsch at schorsch com
+schorsch.com+ -- lighting design tools -- http://www.schorsch.com/
More information about the Python-de
mailing list