-
Notifications
You must be signed in to change notification settings - Fork 1
/
package.py
21 lines (18 loc) · 881 Bytes
/
package.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from zipfile import ZipFile
import glob
import os
# Source: http://stackoverflow.com/questions/458436/adding-folders-to-a-zip-file-using-python
def addFolderToZip(myZipFile,folder,prefixPath):
for file in glob.glob(folder+"/*"):
if os.path.isfile(file):
myZipFile.write(file, prefixPath + "/" + os.path.relpath(file))
elif os.path.isdir(file):
addFolderToZip(myZipFile,file,prefixPath)
with ZipFile('pushfight.zip', 'w') as myzip:
myzip.write('pushfight.exe', 'pushfight/pushfight.exe')
myzip.write('ai.mgbmp', 'pushfight/ai.mgbmp')
myzip.write('ai.mgbmr', 'pushfight/ai.mgbmr')
myzip.write('ai.mgdat', 'pushfight/ai.mgdat')
myzip.write('ai.mgidx', 'pushfight/ai.mgidx')
myzip.write('ai.mgrec', 'pushfight/ai.mgrec')
addFolderToZip(myzip, "pushfight_Data","pushfight")