Re: trouble using \ to escape %

2005-04-15 Thread John Machin
On 15 Apr 2005 16:05:34 -0700, "Lucas Machado" <[EMAIL PROTECTED]> wrote: >I'm writing a python script that modifies the smb.conf file, and i need >to write the characters '%U' in the file. I tried making a string like >so: > >str1 = "[%s%s]\n\tpath = /mnt/samba/%s%s/\%U" % (list[0], list[1], >li

Re: trouble using \ to escape %

2005-04-15 Thread Dan Bishop
Lucas Machado wrote: > I'm writing a python script that modifies the smb.conf file, and i need > to write the characters '%U' in the file. I tried making a string like > so: > > str1 = "[%s%s]\n\tpath = /mnt/samba/%s%s/\%U" % (list[0], list[1], > list[0], list[1]) > > but i keep getting: "TypeErro

Re: trouble using \ to escape %

2005-04-15 Thread Maarten Sneep
In article <[EMAIL PROTECTED]>, "Lucas Machado" <[EMAIL PROTECTED]> wrote: > I'm writing a python script that modifies the smb.conf file, and i need > to write the characters '%U' in the file. print "%s = %%U" % "a" yields a = %U for me. Maarten -- http://mail.python.org/mailman/listinfo/pyt

Re: trouble using \ to escape %

2005-04-15 Thread Rob Williscroft
Lucas Machado wrote in news:1113606334.524947.54630 @l41g2000cwc.googlegroups.com in comp.lang.python: > str1 = "[%s%s]\n\tpath = /mnt/samba/%s%s/\%U" % (list[0], list[1], > list[0], list[1]) > In a format string use '%%' for a single % char': str1 = "[%s%s]\n\tpath = /mnt/samba/%s%s/%%U" % (li