Forum Archive

Import several files at once

bobsmith76

Is there anyway to import several files at once. My program is split into 35 files and I have to import them one at a time. It is extremely tedious.

Also, I'm trying to open up a pickle that is 8 megs large. It takes a lot of time and it crashes before it opens. Is this normal? Of course, I can chop it up into 8 sections and put it back together, but I would rather not do that.

bobsmith76

Actually, the problem just got worse. I forgot that I have json files with 750 files in it that needs to be imported. It is very important that I be able to import these files because they speed up the program enormously.

JonB

Zip the files. Then unzip in pythonista.

JonB

As for large pickles... Are you sure you are importing these correctly, as binary?

Someone recently was trying to open a pkl as text then copy paste...

What sort of data is in the pickle? I.e what types. Is this numpy arrays, or custom classes, etc?