[Tutor] Syntax Error

Kris Kerwin kkerwin at insightbb.com
Fri Jan 6 03:01:22 CET 2006


> On 06/01/06, Kris Kerwin <kkerwin at insightbb.com> wrote:
> >         unix_name = string.replace(new_file_name, ' ', '\ '
>
> Well, there seems to be a closing parenthesis missing on this line
> :-)

Oh. :-)

> By the way --- starting with python2.2 (?), most of the functions
> in the string module are deprecated in favour of calling methods on
> strings themeslves.

Huh. That does seem to make the code a lot cleaner.

Thanks for all of your help!

Kris Kerwin

On Thursday 05 January 2006 19:57, John Fouhy wrote:
> On 06/01/06, Kris Kerwin <kkerwin at insightbb.com> wrote:
> >         unix_name = string.replace(new_file_name, ' ', '\ '
>
> Well, there seems to be a closing parenthesis missing on this line
> :-)
>
> By the way --- starting with python2.2 (?), most of the functions
> in the string module are deprecated in favour of calling methods on
> strings themeslves.
>
> So, instead of saying:
> > new_file_string = string.replace(file_string, ' ', '_SPACE_')
>
> You would say:
>
> new_file_string = file_string.replace(' ', '_SPACE_')
>
> HTH!
>
> --
> John.
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list