title: Running PyQt4 script more than once inside REAPER results in SIP error
body: <p><strong>Some Context:</strong> 
  <a href="https://www.reaper.fm/" rel="nofollow noreferrer">REAPER</a> is a Digital Audio Workstation that has an <a href="https://www.reaper.fm/sdk/reascript/reascripthelp.html" rel="nofollow noreferrer">extensive scripting API</a> with Lua, Python, C/C++ and EEL bindings. I haven't found much information regarding how it handles Python internally. On the surface the configuration involves pointing to a Python DLL somewhere on the system. Screenshot</p>
  
  <p><img src="https://i.stack.imgur.com/oGB0k.png" alt=""></p>
  
  <p><strong>The Problem:</strong>
  I tried running a modified version of the PyQt4 script found <a href="https://stackoverflow.com/a/8555091/10444096">here</a> inside REAPER. At first it worked perfectly</p>
  
  <p><img src="https://i.stack.imgur.com/n8dJG.png" alt=""></p>
  
  <p>On subsequent runs of the same script however an error popped up:</p>
  
  <p><img src="https://i.stack.imgur.com/f4IeS.png" alt=""> </p>
  
  <pre><code> Traceback (most recent call last):
    File "pyqt_test.py", line 2, in &lt;module&gt;
      from PyQt4 import QtGui
  RuntimeError: the sip module has already registered a module called PyQt4.QtCore
  </code></pre>
  
  <p>Restarting REAPER solves the issue for another single run of the script before showing the same error again.</p>
  
  <p>Googling the issue hasn't been much help. There's <a href="https://riverbankcomputing.com/pipermail/pyqt/2011-February/029261.html" rel="nofollow noreferrer">one message</a> on the PyQt mailing list that mentions the error and that the solution involved a package's <code>__init__</code> file but no other elaboration. </p>
  
  <p>Here's the modified script I'm running:</p>
  
  <pre><code>import sys
  from PyQt4 import QtGui
  
  def main():
      sys.argv = [] # necessary because for some reason argv doesnt exist when the script is run inside REAPER
  
      app = QtGui.QApplication(sys.argv)
      widget = QtGui.QWidget()
      layout = QtGui.QGridLayout()
  
      buttons = {}
  
      for i in range(16):
          for j in range(16):
              # keep a reference to the buttons
              buttons[i, j] = QtGui.QPushButton('row %d, col %d' % (i, j))
              # add to the layout
              layout.addWidget(buttons[i, j], i, j)
  
      widget.setLayout(layout)
      widget.show()
      app.exit(app.exec_())
  
  if __name__ == '__main__':
      RPR_defer('main()') # RPR_defer runs supplied code in REAPER's GUI thread.
  </code></pre>
  
  <p>Any ideas as to what's going on and how to workaround/solve it?</p>