title: How to unconditionally re-run a python program based on button click?
body: <p>At the end of my program execution, I want a popup message to appear that has a button which can re-run a program. Obviously, I will have setup a function that the button calls when it is clicked, as such</p>
  
  <pre><code>def restart():
      **python command that makes the whole program restart**
  </code></pre>
  
  <p>Then I would attach this function to the following button:</p>
  
  <pre><code>B1 = ttk.Button(popup, text='Restart program', width=17, command=lambda: restart())
  </code></pre>
  
  <p>Is there such a command?</p>
  
  <p>Quick note:I found an answer but it doesn't work, here it is:</p>
  
  <pre><code>os.execl(sys.executable, sys.executable, *sys.argv)
  </code></pre>