2013-11-26 4 views

Antwort

8

Es teilt Python mit, den Zeilenumbruch unmittelbar nach dem umgekehrten Schrägstrich zu ignorieren. Beginnt der String mit Content-Type:, nicht mit \nContent-Type::

>>> '''\ 
This is the first line. 
This is the second line. 
''' 
'This is the first line.\nThis is the second line.\n' 
>>> ''' 
... This is the first line. 
... This is the second line. 
... ''' 
'\nThis is the first line.\nThis is the second line.\n' 

Hinweis, wie die beiden Ergebnissen abweichen; der erste hat keinen \n Newline-Charakter am Anfang, der andere tut es.