首页 > 解决方案 > 在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'

标签: python

解决方案


推荐阅读