-1
import re
f= ('HelloHowAreYou')
f = re.sub(r"([a-z\d])([A-Z])", r'\1 \2', f)
# Makes the string space separated. You can use split to convert it to list
f = f.split()
print (f)
这工作正常,以大写字母分隔所有的文本字符串,但是当我然后更改代码来阅读文本文件我有问题。任何人都可以解释一下为什么?阅读并删除文本文件
读我使用的文件:
f = open('words.txt','r')