[PyQt] PyQt/SIP snapshots

Phil Thompson phil at riverbankcomputing.com
Wed Apr 1 23:52:12 BST 2009


On Thu, 2 Apr 2009 00:47:31 +0200, David Boddie <david at boddie.org.uk>
wrote:
> On Wednesday 01 April 2009, Phil Thompson wrote:
> 
>> Should be fixed with tonight's snapshots - though I don't have a test
>> case.
> 
> Here's something that might work to start with:
> 
> import sys
> from PyQt4.QtCore import QCoreApplication, QUrl
> from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkReply, 
> QNetworkRequest
> 
> class Test:
> 
>     def __init__(self):
>     
>         request = QNetworkRequest(
>             QUrl("http://www.riverbankcomputing.co.uk/news"))
>         self.manager = QNetworkAccessManager()
>         self.manager.finished.connect(self.handleReply)
>         self.manager.get(request)
>     
>     def handleReply(self, reply):
>     
>         print reply.error()
>         QCoreApplication.quit()
> 
> if __name__ == "__main__":
> 
>     app = QCoreApplication(sys.argv)
>     test = Test()
>     sys.exit(app.exec_())

Seems to work - thanks.

Phil


More information about the PyQt mailing list