On 23/01/2008, Raphael Geissert wrote: > Unless I completely missunderstood something somewhere the second part > should show the path components in reverse order. Yes, no. Adapting aj's example to your particular case: >>> file = "doc/en///index.cache.bz2" >>> file.split('//') ['doc/en', '/index.cache.bz2'] >>> file.rsplit('//') ['doc/en/', 'index.cache.bz2'] You look like expecting a split + reverse (or whatever this function might be called in python) when using rsplit, which actually looks like scanning backward rather than forward. Cheers, -- Cyril Brulebois
Attachment:
pgp4HQOVd5W5n.pgp
Description: PGP signature