Please, use os.path.split method instead of this.