[Tutor] how do I input " as part of a string?

Tom Tucker tktucker at gmail.com
Fri Jul 13 18:27:47 CEST 2007


Try escaping the quotes.

>>> f = open("data.ini","w")
>>> f.write("my \"car\" has been a great one for me")
>>> f.close()

~ >cat data.ini
my "car" has been a great one for me

On 7/13/07, elis aeris <hunter92383 at gmail.com> wrote:
>
> also, why does the interpreter restart when I run this?
>
>
>
> f = open("data.ini","w")
>
> f.write("yeahppe")
>
> f.close()
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070713/e7ee0ff3/attachment.htm 


More information about the Tutor mailing list