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

Alan Gauld alan.gauld at btinternet.com
Sat Jul 14 00:04:29 CEST 2007


"elis aeris" <hunter92383 at gmail.com> wrote

> def send(string):
>    f.write("send( \"%s\"\n' % string )" )
>
> f = open ("data.ini")
>
> send("string is very nice and all those things are pretty cool")
>
> this one is wrong, i guess i didn't ask you how to add things after 
> this

Whats "wrong" about it. It should write out

send( \"string is very nice and all those things are pretty 
cool\"\n' )

> \"%s\"\n' % title)

Does this have any relevance or is it just a curt n paste error?


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld 




More information about the Tutor mailing list