Roy Hinkelman dixit:
> Why don't you simply print out fname? This should point you to the error.
>
> Denis
>
>
> I did here:
> > if fname == old_name:
> > print fname # test
>
> and it looks correct.
>
> On an WinXP, should I use shutil instead?
>
> Roy
Sorry Roy, I rea
On Tue, 2009-12-08 at 14:55 -0800, Roy Hinkelman wrote:
> shutil.copy2(_files_to_mod + "\\" + fname, _files_to_mod + "\\" +
> new_name)
You can make os.path.join sort out the directory seprator for you. It
will add a / under linux and \ under windows.
>>> os.path.join('Testing dir','oldname dir',
I got it.
Switched to shutil and made to paths complete paths. The added benefit is
that it didn't trash the original file.
shutil.copy2(_files_to_mod + "\\" + fname, _files_to_mod + "\\" + new_name)
Thanks.
-- Forwarded message --
From: Roy Hinkelman
Date: Tue, Dec 8, 2009 at
spir wrote:
Roy Hinkelman dixit:
I can't find anything on this error I am getting when renaming some files.
I'm pulling info from a csv file and parsing it to build new file names.
Any pointers appreciated
Roy
My code:
# RENAME FILES using META file - new name = [place]_[state]_[sku].tif
Why don't you simply print out fname? This should point you to the error.
Denis
I did here:
> if fname == old_name:
> print fname # test
and it looks correct.
On an WinXP, should I use shutil instead?
Roy
___
Tutor maillist - T
Roy Hinkelman dixit:
> I can't find anything on this error I am getting when renaming some files.
> I'm pulling info from a csv file and parsing it to build new file names.
>
> Any pointers appreciated
>
> Roy
>
> My code:
> # RENAME FILES using META file - new name = [place]_[state]_[sku].tif
I can't find anything on this error I am getting when renaming some files.
I'm pulling info from a csv file and parsing it to build new file names.
Any pointers appreciated
Roy
My code:
# RENAME FILES using META file - new name = [place]_[state]_[sku].tif
import re, os, csv
# DEFINE
_meta_file