mattia ger...@gmail.com wrote:
So, I'm looking for a way to reset the next() value every
time i complete the scan of a list.
itertools.cycle ?
--
\S
under construction
--
http://mail.python.org/mailman/listinfo/python-list
Il Thu, 02 Apr 2009 13:44:38 +, Sion Arrowsmith ha scritto:
mattia ger...@gmail.com wrote:
So, I'm looking for a way to reset the next() value every
time i complete the scan of a list.
itertools.cycle ?
Perfect, thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Hi all, I a list of jobs and each job has to be processed in a particular
order by a list of machines.
A simple representation is:
# Ordering of machines
JOB1 = [3, 1, 2, 4]
JOB2 = [2, 3, 1, 4]
JOBS = [JOB1, JOB2]
NJOBS = len(JOBS)
Now, I have a list of jobs and I want to have the associated list
mattia wrote:
Hi all, I a list of jobs and each job has to be processed in a particular
order by a list of machines.
A simple representation is:
# Ordering of machines
JOB1 = [3, 1, 2, 4]
JOB2 = [2, 3, 1, 4]
JOBS = [JOB1, JOB2]
NJOBS = len(JOBS)
Now, I have a list of jobs and I want to
Il Sun, 29 Mar 2009 11:17:50 -0400, andrew cooke ha scritto:
mattia wrote:
Hi all, I a list of jobs and each job has to be processed in a
particular order by a list of machines.
A simple representation is:
# Ordering of machines
JOB1 = [3, 1, 2, 4]
JOB2 = [2, 3, 1, 4]
JOBS = [JOB1, JOB2]
mattia wrote:
[i wrote]:
don't you just want to have a new job machine?
for job_list in job_list_list:
job_machine = dict((x+1, iter(JOBS[x])) for x in range(NJOBS)) for x
in job_list:
print(next(job_machine[x]))
ok - btw you can probably simplify the code.
this might work:
Il Sun, 29 Mar 2009 12:00:38 -0400, andrew cooke ha scritto:
mattia wrote:
[i wrote]:
don't you just want to have a new job machine?
for job_list in job_list_list:
job_machine = dict((x+1, iter(JOBS[x])) for x in range(NJOBS)) for x
in job_list:
print(next(job_machine[x]))
ok -