>

文本重命名必发88手机版

- 编辑:www.bifa688.com -

文本重命名必发88手机版

__author__ = 'ZHHT'
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import  datetime

nowTime = datetime.datetime.now().strftime('%Y-%m-%d')

odl_file_name = input("请输入要复制的文件名:")

old =  open(odl_file_name,"r")

position = odl_file_name.rfind(".")
print(position)

new_file_name = odl_file_name[:position]   "[附件]"  nowTime   odl_file_name[position:]

new_file = open(new_file_name,"w")

while True:
    count = old.read(1024)
    if len(count) ==0:
        break
    new_file.write(count)
old.close()
new_file.close()

必发88手机版,  

本文由必发88手机版发布,转载请注明来源:文本重命名必发88手机版