我正在尝试使用AWS Lambda将CSV文件写入S3存储桶,为此我使用了以下代码:
data=[[1,2,3],[23,56,98]]
with open("s3://my_bucket/my_file.csv", "w") as f:
f.write(data)
这会导致以下错误:
[Errno 2] No such file or directory: u's3://my_bucket/my_file.csv': IOError
Traceback (most recent call last):
File "/var/task/lambda_function.py", line 51, in lambda_handler
with open("s3://my_bucket/my_file.csv", "w") as f:
IOError: [Errno 2] No such file or directory: u's3://my_bucket/my_file.csv'
请问我能够得到一些帮助吗?
另外,我的编程语言是Python 2.7
提前感谢您的帮助。