do - loop

Discussion in 'Python' started by Hita Vora, Jan 5, 2008.

  1. Hita Vora

    Hita Vora Guest

    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.

    Any help such as a dummy code would be greatly appreciated.

    Thanks.

    Hita
     
    Hita Vora, Jan 5, 2008
    #1
    1. Advertising

  2. Hita Vora

    Ben Finney Guest

    Hita Vora <> 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
     
    Ben Finney, Jan 7, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VGltOjouLg==?=

    Loop the loop...

    =?Utf-8?B?VGltOjouLg==?=, Feb 16, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    1,417
    Karl Seguin
    Feb 16, 2005
  2. Steven

    while loop in a while loop

    Steven, Mar 24, 2005, in forum: Java
    Replies:
    5
    Views:
    2,290
    Tim Slattery
    Mar 30, 2005
  3. -
    Replies:
    12
    Views:
    717
    Remon van Vliet
    Jun 15, 2005
  4. Byte
    Replies:
    4
    Views:
    438
  5. Isaac Won
    Replies:
    9
    Views:
    458
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page