[Tutor] Syntax Error

John Fouhy john at fouhy.net
Fri Jan 6 02:57:08 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 :-)

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.


More information about the Tutor mailing list