what am I missing in this code (#instead of commented line in code) to have test.py file archived in zip folder ?
#!/usr/bin/python
import zipfile,os
path='/home/user/Desktop'
def zipdir(path, zipf):
for file in os.walk(path):
#zipf.write(os.path.join(root,path))
if __name__ == "__main__":
zipf = zipfile.ZipFile('test.zip', 'w')
zipdir(path, zipf)
zipf.close()