title: Is there anything wrong with a python infinite loop and time.sleep()?
body: <p>I had a program that ran recursively, and while 95% of the time it wasn't an issue sometimes I would hit a recursion limit if I was doing something that took too long. In my efforts to convert to and iterative code, I decided to try something along the lines of this:</p>
  
  <pre><code>while True:
      do something
  
      #check if task is done
      if done:
          print 'ALL DONE'
          break
      else:
          time.sleep(600)
          continue
  </code></pre>
  
  <p>I've tested my code and it works fine, but I was wondering if there is anything inherently wrong with this method? Will it eat up RAM or crash the box if it was left to run for too long? </p>
  
  <p>Thanks in advance!</p>
  
  <p>EDIT:</p>
  
  <p>The "do something" I refer to is checking a log file for certain keywords periodically, as data is constantly being written to the log file. Once these lines are written, which happens at varying length of times, I have the script perform certain tasks, such as copying specific lines to a separate files. </p>
  
  <p>My original program had two functions, one called itself periodically until it found keywords, which would then call the 'dosomething' function. The do something function upon completion would then call original function, and this would happen until the task was finished or I hit the recursion limit </p>