I'm not sure what you're trying to do
but I guess you want to tokenize your text and then strip each token if that so
here what you could do
with open("file.txt", "r") as f:
tokens = f.read().split(" ")
tokens = [item.strip() for item in data]
EDIT
with open("file.txt", "r") as f:
lines = f.read().split("
")
Flag = False
FirstPart = []
LastPart = []
for line in lines:
if len(line) == 0:
Flag = True
if not Flag:
FirstPart.append(line)
else:
LastPart.append(line)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…