0
私はPythonで0.html、1.html、2.htmlを3秒間の遅延で表示する簡単なスライドショーを作っています。Webページのスライドショー(python)
以下のスクリプトは0.htmlを3秒で表示し、「セグメンテーションフォルト(コアダンプ)」エラーが表示されます。何か案は?これまで
マイコード:
#!/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 < 3):
page = "%s.html" % x
playWidget(page , 3)
x = x + 1