breaking the look in jython
        Posted  
        
            by kdev
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by kdev
        
        
        
        Published on 2010-03-27T05:02:10Z
        Indexed on 
            2010/03/27
            5:13 UTC
        
        
        Read the original article
        Hit count: 224
        
jython
Hi everyone ,
I have a written a loop for and if condition and i want to break to loop completely when if gets satisfied.
while count:
    i=0
    for line in read_record:
        #print str.strip(count[1:28])
        #print str.strip(read_record[i])
        if string.find(str.strip(read_record[i]),str.strip(count[1:28]))>0:
            code=str.strip(read_record[i+19])+str.strip(read_record[i+20])
            print code[25:]
            break
        i=i+1
so here if the    if string.find condition gets satified i want to go to while loop flow.  Please tell me what will be the best place to break and how should i modify the program so that once the if condition is satified iam out of the loop and start again with while loop . 
© Stack Overflow or respective owner