I have a script in the IBM Quantum lab which runs several jobs and stores the result of each job as a .txt file in a results folder. All I want to do is to download the folder of files. I cannot figure out how to do this and so at the moment I have to open the folder in the Quantum Lab and then select each file and individually download it. This is getting very tiresome.

I feel like I must be missing something really simple that would enable me to just download the folder, but when I click on the dropdown menu for the folder, all it allows me to do is to rename or delete it.

Sorry for the stupid question!

  • $\begingroup$ Welcome to QCSE! Not a stupid question :) I don't think there is an option for you to download the entire folder like you asked. In my opinion, QuantumLab is designed for light work. If you do extensive amount of work then it might be best to download qiskit to your local machine and use it that way... But there are certain things that one might need to use QuantumLab, for instance if you want to use PySCF but only have access to a window machine.... $\endgroup$
    – KAJ226
    Jul 10 '21 at 0:42
  • $\begingroup$ can you try zipping the folder of txt files with the script? $\endgroup$
    – Van Peer
    Jul 10 '21 at 7:58
  • $\begingroup$ Consider storing the results of all jobs in a single txt file. $\endgroup$ Jul 10 '21 at 8:11

I don't think there is a feature to download a folder, but you can download the folder by zipping it first. To zip the folder, write in a new cell:

!zip -r MyFolder.zip path/to/folder

Then you can download the zip file. If you only want to download the .txt files, you can write:

!zip MyFolder.zip path/to/folder/*.txt

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.