Anoop wrote: > Hi All, > > I am getting the following error while trying to use deprecation > > Please help > >>>> li = ["a", "b", "mpilgrim", "z", "example"] >>>> newname = string.joinfields (li[:-1], ".") >>>> newname > 'a.b.mpilgrim.z' >>>> newname = li[:-1].joinfields(".") > Traceback (most recent call last): > File "<interactive input>", line 1, in ? > AttributeError: 'list' object has no attribute 'joinfields' > >>>> newname1 = string.join (li[:-1], ".") >>>> newname1 > 'a.b.mpilgrim.z' >>>> newname = li[:-1].joinfields(".") > Traceback (most recent call last): > File "<interactive input>", line 1, in ? > AttributeError: 'list' object has no attribute 'join' > > Thank you for your help > > Anoop > I think you want:
newname1='.'.join(li[:-1]) -Larry Bates -- http://mail.python.org/mailman/listinfo/python-list