R
royG
hi
i am trying to rename extension of files in a directory..as an initial
step i made a method in
class ConvertFiles:
def __init__(self,infldr,outfldr):
self.infldr=infldr
self.outfldr=outfldr
self.origlist=os.listdir(infldr)
.....
def renamefiles(self,extn):
for x in self.origlist:
x=x+"."+extn
....
later when i print self.origlist i find that the elements of list are
unchanged..even tho a print x inside the renamefiles() shows that
extn is appended to x ..
why does this happen?
RG
i am trying to rename extension of files in a directory..as an initial
step i made a method in
class ConvertFiles:
def __init__(self,infldr,outfldr):
self.infldr=infldr
self.outfldr=outfldr
self.origlist=os.listdir(infldr)
.....
def renamefiles(self,extn):
for x in self.origlist:
x=x+"."+extn
....
later when i print self.origlist i find that the elements of list are
unchanged..even tho a print x inside the renamefiles() shows that
extn is appended to x ..
why does this happen?
RG