我的python程序未显示任何输出

时间:2019-05-05 10:51:14

标签: python-2.7

from urllib import request

google_url='https://www.stats.govt.nz/assets/Uploads/Annual-enterprise-survey/Annual-enterprise-survey-2017-financial-year-provisional/Download-data/annual-enterprise-survey-2017-financial-year-provisional-size-bands-csv.csv'


def dooo(csv_url):

    response= request.urlopen(csv_url)
    csv=response.read()
    csv_str=str(csv)
    lines = csv_str.split('\\n')
    dest_url=r'google.csv'
    fx=open(dest_url,"w")

    for line in lines:
       fx.write(line  +"\n")
       fx.close()

    dooo(google_url)

此程序应创建一个csv文件并显示输出 但没有显示任何结果

0 个答案:

没有答案