python - 在python中打开文本文件时如何解决\u202a错误?
问题描述
我正在尝试获取输出,但是出现了这个错误,我不知道如何解决它,有人可以帮忙吗? #代码:
f = open('E:\\myfile.txt')
data = f.read()
count = 0
vowel = list("aeiouAEIOU")
for x in data:
if x in vowel:
count += 1
print("Number of vowels ",count)
这是输出:
f = open('E:\\myfile.txt')
OSError: [Errno 22] Invalid argument: '\u202aE:\\myfile.txt'
解决方案
推荐阅读
- css - VueJS 中带有 CSS 过渡的简单淡入淡出入口
- vue.js - element-ui v-for 无法附加数组
- javascript - 路由器出口Angular 6上的访问元素
- coq - coq 中的多态数据类型中是否允许强制转换?
- php - php中有readdirectory函数吗
- scala - 对 Play for Scala 中的“内存不足错误:元空间”进行故障排除
- python - 熊猫:删除列表中名称并分配给新数据框的多个列
- html - HTML 页面 - 扩展数据
- php - 在 Woocommerce 中复制挂钩函数时避免错误 500
- html - SVG 图像 - 固定高度 - 保持比例 - 切片