Commit 6ef39fb0 by BellCodeEditor

save project

parent 6f256089
Showing with 11 additions and 2 deletions
......@@ -5,6 +5,14 @@
#with open(r'C:\Users\EDY\diy','a',encoding='utf-8')as file1:
#file1.write('小兰:12本\n')
#with open(r'C:\Users\EDY\diy','r',encoding='utf-8')as file1:
#a=file1.read()
#print(a)
vgy=''
with open(r'C:\Users\EDY\diy','r',encoding='utf-8')as file1:
a=file1.read()
print(a)
for sgs in file1:
if'小兰:12本'in sgs:
sgs=sgs.replace('小兰:12本','小兰:10本')
vgy+=sgs
with open(r'C:\Users\EDY\diy','w',encoding='utf-8')as file1:
file1.write(vgy)
\ 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