2015-07-06 24 views
0

我正在使用基於python的龍捲風web服務器。 我想從網絡服務器的客戶端下載一個zip文件。如何提供一個基於python的龍捲風web服務器的zip文件?

我可以提供一個簡單的.csv文件,但不能提供.zip文件。


這就是如何使下載的.csv文件:

enter image descriptio![enter image description here

...

enter image description here


這是我想成爲一個.zip文件: enter image description here

當我嘗試下載文件時,我收到此錯誤信息:

enter image description here

回答

2

在Python 3,如zip文件的二進制文件必須以二進制模式打開。使用「rb」而不是「r」作爲open()的第二個參數。