Commit 0cbfa9c2 by BellCodeEditor

save project

parent 8666c2e7
Showing with 4 additions and 2 deletions
......@@ -6,9 +6,11 @@
with open(r'C:\Users\Administrator\Desktop\test.txt',a',encoding='utf-8' ) as file:
file.write("小兰:12本")
file.write("小明:1000000000000本")
new_data=""
with open(r'C:\Users\Administrator\Desktop\test.txt',r',encoding='utf-8' ) as file:
for data in file:
if "小兰:12本" in data:
print("**************")
data=data.preplace('小兰:12本','小兰:2000000000000000000000000000000000本')
new_data +=data
print(naw_data)
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