When writing text. . .

Daniel Nogradi nogradi at gmail.com
Fri Jul 14 19:06:25 EDT 2006


> 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')
>
> I expected that to work, but instead of C:\windows\aawin.bat I get
> run=C:\windowsawin.bat. . .
> I assume /a is a code for  like /n is for a newline, is there a way to fix
> this?

win.write( '\\a' )



More information about the Python-list mailing list