Commit fd0f5110 by BellCodeEditor

save project

parent 7c64a79a
Showing with 7 additions and 3 deletions
with open(r"C:\Users\86185\Desktop\VScode-python\money.txt",'r',encoding='UTF-16') as f:
\ No newline at end of file
with open(r"C:\Users\86185\Desktop\book.txt",'r',encoding='UTF-16') as f: with open(r"C:\Users\86185\Desktop\Python文件\book.txt",'r',encoding='UTF-16') as f:
b=input("请输入要查询的人:") b=input("请输入要查询的人:")
h="" h=""
for i in f: for i in f:
if b in i: if b in i:
g=i # g=i
print("找到了") print("找到了")
q=input("请输入想修改成的值:") q=input("请输入想修改成的值:")
i=q+"\n" # i=q+"\n"
i=i.replace(i,q+"\n")
h+=i h+=i
with open(r"C:\Users\86185\Desktop\book.txt",'w',encoding='UTF-16') as f: with open(r"C:\Users\86185\Desktop\book.txt",'w',encoding='UTF-16') as f:
f.write(h) f.write(h)
......
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