import urllib.request
fw = open("myfile.txt", "r")
red = fw.read()
line = red.split("\n")
blue = line.split("@")[0]
i=0
while i<len(blue):
try:
try code is here
try:
try code is here
except:
print(blue[i] + " is " + "having e1")
except:
print(blue[i] + " is " + "having e2")
i+=1
我得到了
错误2没有这样的文件或目录
当我试图运行我的文件时。但是,当我移除线路时
blue = line.split("@")
它工作得很好。
我想做的是在
myfile.txt
-所以我分手了
\n
首先要得到文件的一行,然后我要得到之前的字符
@
把它放在绳子上
blue