标签:work with 研发 时间 coding import rem center rip
燃料电池研发时间比较赶 没有时间敲代码 晚上看了会视频 学了一点点东西 写一下
keep working
# s = ‘aaaabcc‘
# print(s.rjust(5,"#"))
# print(s.center(5,"s"))
# print(s.rstrip("b"))
# list1 = [1,2,3,4,5,6]
# list2 = list1.copy()
# print(list2)
# print(id(list1),id(list2))
# list1.insert(2,9)
# print(list1)
with open(‘d‘,encoding="utf=8") as f,open("d.bak",‘w‘,encoding =‘utf-8‘) as f2:
for line in f:
if ‘a‘in line:
line = line.replace(‘a‘,"b")
f2.write(line)
import os
os.remove(‘d‘)
os.rename(‘d.bak‘,‘d‘)
标签:work with 研发 时间 coding import rem center rip
原文地址:https://www.cnblogs.com/mini-c/p/9643864.html