Created
August 23, 2017 10:41
-
-
Save lapshinmr/0547dd36c77898205238aef450f7ce4f to your computer and use it in GitHub Desktop.
Revisions
-
lapshinmr created this gist
Aug 23, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ return send_file(BytesIO(open(z.filename, 'rb').read()), attachment_filename=curdir_basename + '.zip', as_attachment=True) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ import zipfile with zipfile.ZipFile(os.path.join(curdir, curdir_basename + '.zip'), 'w') as z: for f_path in [a_path, w_path, q_path]: z.write(f_path, os.path.basename(f_path))