Rats, a premature posting sorry. > > Also, just as interesting, yet probably less reliable: > > > > a = list(a) > > a[-3:] = 'bak' > > a = "".join(a) > > > The problem with all of these versions is they assume the > extension will be three characters long. In DOS it could be *up to* > three characters, but in Windows post 95 the extension can be longer, > eg .html is often seen. And on non Windows platforms loing extensions > are common.
> > > x=os.path.splitext(a)[0]+'.bak' Whereas this technique handles the different size extensions safely. Alan G. _______________________________________________ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor