Le Sat, 4 Apr 2009 20:05:41 -0400,
Kent Johnson s'exprima ainsi:
> On Sat, Apr 4, 2009 at 3:37 PM, Christopher Spears
> wrote:
> >
> > I want to write a script that takes a list of images and renumbers them
> > with a user supplied number. Here is a solution I came up while noodling
> > around
Christopher Spears wrote:
I want to write a script that takes a list of images and renumbers
them with a user supplied number. Here is a solution I came up while
noodling around in the interpreter:
>>> alist = ["frame.0001.tif","frame.0002.tif","frame.0003.tif"]
>>> new_start = 5000
>>> for x i
On Sat, Apr 4, 2009 at 3:37 PM, Christopher Spears
wrote:
>
> I want to write a script that takes a list of images and renumbers them with
> a user supplied number. Here is a solution I came up while noodling around
> in the interpreter:
>
alist = ["frame.0001.tif","frame.0002.tif","frame.
I want to write a script that takes a list of images and renumbers them with a
user supplied number. Here is a solution I came up while noodling around in
the interpreter:
>>> alist = ["frame.0001.tif","frame.0002.tif","frame.0003.tif"]
>>> new_start = 5000
>>> for x in alist:
... name, nu
One problem with my previous post. I didn't look closely enough at the
original list of files, it turns out you have multiple entries for some of
them. If you used the glob module to create this list (with something like
"original_list = glob.glob('frame.*.dpx')"), then there should be no problem
I am thinking along similar lines as Simone, but I suspect there is still a
missing step. I think you need to know what the mapping is from old name to
new name, so that you can do something like rename or copy the files that
these names represent.
Python's built-in zip() method does the trick he
"Christopher Spears" <[EMAIL PROTECTED]> wrote
ordered_list = sorted(unordered_list)
test_frame_1 = ordered_list[0].split('.')[1]
test_frame_2 = ordered_list[1].split('.')[1]
if test_frame_1 == "":
if test_frame_2 =! "0001":
print "Sequence needs to be renumbered"
for frame in
Christopher Spears ha scritto:
As you can see, the only part I haven't figured out is the actual renumbering.
Can't figure out how to do the following:
0017 convert to -> 0001
0018 convert to -> 0002
0019 convert to -> 0003
etc.
Any hints? Thanks.
IMHO, you can renumber everything without
I'm trying to write a script that will renumber items in a list. Here is the
list:
unordered_list = ["frame.0029.dpx",
"frame.0028.dpx",
"frame.0025.dpx",
"frame.0026.dpx",
"frame.0027.dpx",
"frame.0017.dpx",
"frame.0019.dpx",
"frame.0023.dpx",
"frame.0018.dpx",