首页 推荐 热点 专题 PHPJavaPythonAndriodIOSC#前端数据库人工智能程序开发架构安全运维资讯微课资源
0
点赞
收藏
分享

微信扫一扫

python3 TypeError: 'map' object is not subscriptable

陆公子521 2022-10-13 阅读 169
python虚拟化云计算


add “list” to map,eg:

return list(map(apply_filters_to_token, sentences))

eg2:

In Python 3 map returns a generator. Try creating a list from it first.

with open("/bin/ls", "rb") as fin: #rb as text file and location
buf = fin.read()
bytes = list(map(ord, buf))
print (bytes[:10])
saveFile = open('exampleFile.txt', 'w')
saveFile.write(bytes)
saveFile.close()


举报
0 条评论
陆公子521
关注
  • 企业能源管理供电供水数据采集监测管理解决方案
  • 深度揭秘!从源码级剖析 Android 基础知识体系
  • 掌握软件开发中的人工智能:为什么方法比工具更重要
  • 迈向高级开发者的必经之路
  • ElementUI 的 form 表单校验
  • Android Studio 安卓模拟器、虚拟机的内存修改方式详细图文教程
  • 上门预约服务小程序开发,便捷生活,一键预约
  • XYkeep健身小程序健身房瑜伽馆游泳馆篮球馆健身培训场所课程预约多门店私教预约系统
  • 模型压缩理论简介及剪枝与稀疏化在 征程 5 上实践
  • Python学习------第十天