def get_p1p2data(self):
import urllib, os
if self.file_exist():
print "No need to download P1P2 DCB data..."
return
print "Start to download P1P2 DCB data..."
weblink = "ftp://ftp.unibe.ch/aiub/CODE/{0}/".format(self.year)
if not os.path.isfile(self.sourcefn):
try:
download = urllib.URLopener()
download.retrieve(weblink+self.sourcefn, self.sourcefn)
except IOError:
weblink = "ftp://ftp.unibe.ch/aiub/CODE/{0}/".format(self.year_bom)
download = urllib.URLopener()
download.retrieve(weblink+self.sourcefn_bom, self.sourcefn)
os.system("gzip -fd {0}".format(self.sourcefn))
评论列表
文章目录