dongdong wrote:
I wrote as following:
content=urllib2.urlopen("http://www.sdfagfa.org/asasg/a.zip").read()
f=open("d:\\a.zip",'a+',1)
f.writelines(content)
the zip file has been download to my machine,but when be unzip , error
occurs:
" there is an error at the end of the file"
f=open("d:\\a.zip",'a+',1)
Here you want to open a.zip as a text file (default) for appending, in
both read and write mode.
I think sufficient would be
f=open("d:\\a.zip",'wb')
For opening a new file and writing as binary.
Then you will want:
f.write(content)
f.close()
James
--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095
http://www.jamesstroud.com/