文件备份
Posted liufengji
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了文件备份相关的知识,希望对你有一定的参考价值。
```python
file_Name = input("请输入要备份的文件名")
file_1 = open(file_Name,"r")
index = file_Name.rfind(‘.‘)
if index > 0:
new_name = file_Name[:index]+"备份"+file_Name[index:]
else:
new_name = file_Name+"备份"
file_2 = open(new_name,"w")
count = file_1.read()
file_2.write(count)
file_1.close()
file_2.close()
```
以上是关于文件备份的主要内容,如果未能解决你的问题,请参考以下文章
在Tomcat的安装目录下conf目录下的server.xml文件中增加一个xml代码片段,该代码片段中每个属性的含义与用途