"S3 operation failed; code: NoSuchKey, message: The specified key does not exist., resource: /pictures/4dccaee1949f4d89e40d3de3969775f_xiong.jpeg, request_id: 176391A58D9A5783, host_id: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855, bucket_name: pictures, object_name: 4dccaee1949f4d89e40d3de3969775f_xiong.jpeg"python 怎么去掉两边的双引号,变成这个样子S3 operation failed; code: NoSuchKey, message: The specified key does not exist., resource: /pictures/4dccaee1949f4d89e40d3de3969775f_xiong.jpeg, request_id: 176391A58D9A5783, host_id: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855, bucket_name: pictures, object_name: 4dccaee1949f4d89e40d3de3969775f_xiong.jpeg
时间: 2024-02-07 22:04:19 浏览: 199
Mysql:The user specified as a definer ('xxx@'%') does not exist的解决方案
5星 · 资源好评率100%
可以使用字符串的切片操作来去掉两边的双引号,如下所示:
```
s = """"S3 operation failed; code: NoSuchKey, message: The specified key does not exist., resource: /pictures/4dccaee1949f4d89e40d3de3969775f_xiong.jpeg, request_id: 176391A58D9A5783, host_id: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855, bucket_name: pictures, object_name: 4dccaee1949f4d89e40d3de3969775f_xiong.jpeg""""
s = s[1:-1]
print(s)
```
输出:
```
S3 operation failed; code: NoSuchKey, message: The specified key does not exist., resource: /pictures/4dccaee1949f4d89e40d3de3969775f_xiong.jpeg, request_id: 176391A58D9A5783, host_id: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855, bucket_name: pictures, object_name: 4dccaee1949f4d89e40d3de3969775f_xiong.jpeg
```
阅读全文