2012-09-25 5 views
0

나는이 :줄 바꿈 올인원 파이썬 문자열

... 
post_str = "Please input the following information... \nDescription: \n Last Name:" 
context = { 
    'post_str':post_str, 
     ... 
} 
return render_to_response('contact/contact.html', context, context_instance=RequestContext(request)) 

그것은,과 같이

Please input the following information... Description: Last Name: 인쇄합니다.

하지만 그것은 인쇄하고 싶습니다은 :

Please input the following information... 
Description: 
Last Name: 

내가 올바르게 사용하고 있었다 생각했다. 내가 원하는 것을 성공적으로 생산할 수있는 새 라인을 어떻게 얻을 수 있습니까?

미리 도움을 주셔서 감사합니다.

+2

실제 코드를 표시합니다 (예 : 인쇄 방법). – jamesdlin

+0

Django/Python을 사용하고 있다고 말해야합니다. 미안합니다. – Modelesq

답변

1

개행 문자는 HTML에서 아무 것도하지 않습니다. 대신 <br />을 사용하십시오.