Helllo ,
I want to create a zip file that contiens only 1 file
this is what I have done:
but when I open the zip file I need to go to 4 folders
/home/pi/logs/Outputfile.txt
I have also try to cut the location
but then he create me a zip inside the zip and it't corrupted
what do I need to do in order to make put only the OutputFile.txt in the zip ?
Thanks ,
I want to create a zip file that contiens only 1 file
this is what I have done:
with ZipFile(ZipLocation, 'w') as zipObj: zipObj.write(OutputFile, compress_type=compression)this create me 1 zip file as planed
but when I open the zip file I need to go to 4 folders
/home/pi/logs/Outputfile.txt
I have also try to cut the location
ZipLocation = '/home/pi/logs/CanBusData.zip' ZipName = ZipLocation.split(os.sep)[-1] with ZipFile(ZipLocation, 'w') as zipObj: zipObj.write(OutputFile, arcname=ZipName, compress_type=compression)
but then he create me a zip inside the zip and it't corrupted
what do I need to do in order to make put only the OutputFile.txt in the zip ?
Thanks ,