man=[]
other=[]
try:
date=open('sketchone.txt')
for each_spoken in date:
try:
(role,spoken)=each_spoken.split(':',1)
spoken=spoken.strip()
if role=='Man':
man.append(spoken)
elif role=='Other Man':
other.append(spoken)
except ValueError:
pass
date.close()
except IOError:
print('file is missing')
try:
man_file=open('man_dateone.txt','w')
other_file=open('other_dateone.txt','w')
print('man',file=man_file)
print(other,file=other_file)
man_file.close()
other_file.close()
except IOError:
print('error')
嘿嘿嘿我居然自己发现了~~~~~~~格式问题格式问题嘿嘿嘿