-1
我在youtube上從newboston系列學習python。這來自教程24從Web下載文件。我已經寫在同一個程序上的視頻:Python屬性錯誤:'_io.TextIOWrapper'對象沒有屬性'wirte'
from urllib import request
goog_url = 'https://docs.google.com/spreadsheet/ccc?
key=0At2sqNEgxTf3dEt5SXBTemZZM1gzQy1vLVFNRnludHc&output=csv'
def download_stock_data(csv_url):
response = request.urlopen(csv_url)
csv = response.read()
csv_str = str(csv)
lines = csv_str.split("\\n")
dest_url = r'goog.csv'
fx = open(dest_url, "w")
for line in lines:
fx.wirte(line + "\n")
fx.close()
download_stock_data(goog_url)
,但我得到這些錯誤:
Traceback (most recent call last):line 18, in <module>
download_stock_data(goog_url)
line 14, in download_stock_data
fx.wirte(line + "\n")
AttributeError: '_io.TextIOWrapper' object has no attribute 'wirte'
任何幫助是極大的讚賞。