title: while loop calling array outside
body: <p>Ill start again and thank you all for replying.</p>
  
  <p>I have a log file, and i take the entry and remove all rubbish from it.
  the array or list i am left with is this</p>
  
  <pre><code>23
  23.23.23.23
  45
  45.45.45.45
  100
  34.34.54.13
  </code></pre>
  
  <p>how i call each line i want is with this.</p>
  
  <pre><code>a = 1
  while a &lt; 18:
      a = a + 2
      #logging.debug(line.split(PID_ANDROID)[a])
      countIP = a
      trySomething()
  
      if a == 20:
          break
  </code></pre>
  
  <p>but i have to do things after i call it.
  i want to be able to use the first entry,</p>
  
  <pre><code>&gt; do something 
  &gt; see if something is happening
  &gt; if its not goto 3rd entry
  &gt; try the same thing again.
  </code></pre>
  
  <p>this is what I am stuck on.
  because when I call it from inside something else and I use global to store.
  python tells me I cant us a str or turp. or with code below gives me a continues output of everything in the list.</p>
  
  <p>atm i have this code.</p>
  
  <pre><code>def trySomething():
  global countIP
  global LOG_SPLITER
  #logging.debug('Processing Number: %s' % (countIP,))
  logging.debug(LOG_SPLITER.split(PID_ANDROID)[countIP])
  time.sleep(.5)
  clearScreen()
  #grabBox90()
  #lineGoto()
  </code></pre>
  
  <p>my question is.
  how can i do the loop, and pull out only one at a time to do something with it, and when i get to a finished loop goto the next one?</p>