Slideshow of web pages (python)
<p>I'm trying to make a simple slideshow in Python to view 0.html, 1.html and 2.html with 3 seconds delay between them.</p>

<p>The script below shows 0.html in 3 seconds, then I get a "Segmentation fault (core dumped)" error. Any ideas?</p>

<p><strong>My code so far:</strong></p>

<pre><code>#!/usr/bin/python
import sys

from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
import urllib


class Window(QWidget):

    def __init__(self, url, dur):
        super(Window, self).__init__()
        view = QWebView(self)
        layout = QVBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(view)

        html = urllib.urlopen(url).read()       
        view.setHtml(html)
        QTimer.singleShot(dur * 1000, self.close)


def playWidget(url, dur):
        app = QApplication(sys.argv)
        window = Window(url, dur)
        window.showFullScreen()
        app.exec_()

x = 0
while (x &lt; 3):
    page = "%s.html" % x
    playWidget(page , 3)
    x = x + 1
</code></pre>