This is os-specific - you might want os.path.basename().