qt - Where did file downloaded with PyQt5 network access manager go? And how do I save it? -
without specifying file save, created this:
def start_download(self): self.reply = self.manager.get(qnetworkrequest(qurl(self.url_edit.text()))) self.reply.downloadprogress.connect(self.download_progress) self.label.settext(self.url_edit.text()) def download_progress(self, received, total): print(received, type(received))
the last function mentioned did write received byte. so, downloaded. did go without specified path save? , how can save it?
the reply qnetworkreply, subclass of qiodevice. so, equivalent file-like objects found in python.
once file has downloaded, should able like:
data = self.reply.readall().data()
which give python byte-string can saved disk in usual way.
Comments
Post a Comment