do - loop

Ben Finney bignose+hates-spam at benfinney.id.au
Mon Jan 7 04:05:24 EST 2008


Hita Vora <hvora at usc.edu> writes:

> I have a dataset which has about 3000 subjects in it. I take each
> subject and perform 3 to 4 geoprocessing tasks on it. Currently I
> have a model where I manually feed in each subject's ID and then the
> rest of the process is automated. I would like to automate the
> process such that it would automatically select another subject
> after the process has been completed on a specfic subject. ie to
> repeat the same process on each of the IDs.

    def do_the_stuff(subject):
        """ Do the stuff to a single subject """
        pass

    for this_subject in all_subjects:
        do_the_stuff(this_subject)

-- 
 \     "Unix is an operating system, OS/2 is half an operating system, |
  `\           Windows is a shell, and DOS is a boot partition virus." |
_o__)                                                 —Peter H. Coffin |
Ben Finney



More information about the Python-list mailing list