title: Difference between os.execl() and os.execv() in python
body: <p>Is there a difference between os.execl() and os.execv() in python? I was using </p>
  
  <pre><code>os.execl(python, python, *sys.argv) 
  </code></pre>
  
  <p>to restart my script (from <a href="https://www.daniweb.com/software-development/python/code/260268/restart-your-python-program-" rel="noreferrer">here</a>). But it seems to start from where the previous script left. </p>
  
  <p>I want the script to start from the beginning when it restarts. Will this</p>
  
  <pre><code>os.execv(__file__,sys.argv)
  </code></pre>
  
  <p>do the job? <a href="http://blog.petrzemek.net/2014/03/23/restarting-a-python-script-within-itself/" rel="noreferrer">command and idea from here.</a> I couldn't find difference between them from the python help/documentation. Is there a way do clean restart? </p>
  
  <p>For a little more background on what I am trying to do please see <a href="https://stackoverflow.com/questions/31358737/monitoring-if-a-file-stopped-writing-in-python/">my other question</a></p>