Commit bb5c8e70 by BellCodeEditor

save project

parent 08eb5e00
Showing with 12 additions and 3 deletions
with open(r'C:\Users\22747\Desktop\www.txt,"r",encoding="utf-8")as a:
b=a.readlines()
print(b)
x= open(r'C:\Users\bell007\Desktop\test.txt,'w',encoding='utf-8')
x.write("小兰:12本\n")
x.close()
with open(r'C:\Users\bell007\Desktop\test.txt,'a',encoding='utf-8')as x:
x.write("小明:6本\n")
x.write("小军:6本\n")
with open(r'C:\Users\bell007\Desktop\test.txt,'r',encoding='utf-8')as x:
for data in x:
if"小明:6本"in data:
print("数据在文件中")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment