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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -