'Make ZipFile write a backslash to a filename

I want my zipped filenames to contain a backlash, but unfortunately I can't get it to work. Currently I use:

from zipfile import ZipFile

zipObj = ZipFile('sample.zip', 'w')
zipObj.write("sampleFile.png", "\sampleName.png")
zipObj.close()

It simply omits the backlash in the filename.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source