Zipping files? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Zipping files?

Guys i have a university lab task, i did the Spyder coding questions and placed them in a file. How do i zip the fike so i can upload it to moodle?

2nd Oct 2020, 12:15 PM
Zami Gaming
Zami Gaming - avatar
2 Answers
+ 1
import zipfile, os os.chdir('your/directory/location') # <<<<<< newZip = zipfile.ZipFile('.zip', 'w') # ^^^ name your zipfile newZip.write('', compress_type=zipfile.ZIP_DEFLATED) # ^^^ inter your file name here newZip.close()
9th Oct 2020, 4:25 AM
Dawit Mekonnen
Dawit Mekonnen - avatar
+ 1
File or directory zipper You have to choose the location where you want your file to be saved before doing anything https://code.sololearn.com/cxNt077Xzm1Q/?ref=app
9th Oct 2020, 6:49 AM
Dawit Mekonnen
Dawit Mekonnen - avatar