Re: Rename multiple files using names in a text file

2007-09-15 Thread rémi
Le Fri, 14 Sep 2007 12:52:52 -0700, James Stroud a écrit: [...] > Other than that your strip() is stripping off some whitespace that is > part of the name, I really can't see the problem either, but did you try > to add in the explicit path? E.g.: actually, the problem was in "while i <= len(li

Re: Rename multiple files using names in a text file

2007-09-14 Thread James Stroud
rémi wrote: > Hi, > > I would like to rename files (jpg's ones) using a text file containing the > new names... > Below is the code that doesn't work : > * > #!/usr/bin/python > #-*- coding: utf-8 -*- > from os import listdir, getcwd, rename > import re > list_names=['new_name1','new_name2'] >

Rename multiple files using names in a text file

2007-09-14 Thread rémi
Hi, I would like to rename files (jpg's ones) using a text file containing the new names... Below is the code that doesn't work : * #!/usr/bin/python #-*- coding: utf-8 -*- from os import listdir, getcwd, rename import re list_names=['new_name1','new_name2'] list_files = listdir(getcwd()) filt