On 2006-08-16, Hitesh <[EMAIL PROTECTED]> wrote: > anything after .exe should be truncated (or deleted).
That will fail if any directory names contain the string ".exe", but if that's what you want, it's trivial enough: for s in ["asdfasdf.exe -u", "soemthing/else", "asdf.exe/qwerqwer/qwerqwer.exe"]: print `s`, i = s.find(".exe") print i, if i >= 0: s = s[:i+4] print `s` -- Grant Edwards grante Yow! Yow! It's some people at inside the wall! This is visi.com better than mopping! -- http://mail.python.org/mailman/listinfo/python-list