Bruno Desthuilliers schrieb: > > Let me guess : your cgi script is running on *n*x ?-) >
Pretty hard to get this one, heh? :-D > > Probably. Good that you decided I was worth the information. > >>> fnames = "C:\\dir\\data.ext", "/dir/data.txt", "dir:data" > >>> import ntpath, posixpath, macpath > >>> def basename(filename): > ... for m in ntpath, posixpath, macpath: > ... if m.sep in filename: > ... return m.basename(filename) > ... else: > ... # XXX > ... raise SomeException('could not do the job') > ... > >>> for f in fnames: > ... print f, basename(f) > ... > C:\dir\data.ext data.ext > /dir/data.txt data.txt > dir:data data > >>> > Thnaks a lot. :) Thomas -- http://mail.python.org/mailman/listinfo/python-list