私はPythonで作業しており、以下に示すように「_headers」という変数を定義しています
_headers = ('id',
'recipient_address_1',
'recipient_address_2',
'recipient_address_3',
'recipient_address_4',
'recipient_address_5',
'recipient_address_6',
'recipient_postcode',
)
これを出力ファイルに書き込むために、次のステートメントを作成しましたが、「AttributeError: 'str' object has no attribute 'write'」というエラーがスローされます。
with open(outfile, 'w') as f:
outfile.write(self._headers)
print done
助けてください