When writing text. . .

Ivan Shevanski darkpaladin79 at gmail.com
Mon Jul 24 16:40:58 EDT 2006


On 7/14/06, Gerhard Fiedler <gelists at gmail.com> wrote:
>
> On 2006-07-14 18:05:56, Ivan Shevanski wrote:
>
> > Hey I'm pretty new to python and I have a question.  I'm trying to
> write:
> > "[BOOT]
> > run=C:\windows\aawin.bat"
> >
> > in my win.ini
> > So I went about it like this:
> >
> > win = open('C:\windows\win.ini', 'a')
> > win.write('[BOOT]')
> > win.write('\n')
> > win.write('run=C:\windows\aawin.bat')
>
> Maybe write a '\n' before the [BOOT] -- unless you can guarantee that the
> previous line ends with a CRLF.
>
> BTW, it's probably a good thing to always escape the backslash (that is,
> use '\\') when you want a backslash, not only for the '\\a' case. Or of
> course use a raw string.
>
> Gerhard
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
Sorry about the late response, I was away.  Thanks for all the help =D


-- 



-Ivan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060724/f351fb36/attachment.html>


More information about the Python-list mailing list