标签:final inpu 打开 print err bre error def not
def mycopy(src_filename, dst_filename): try: fr = open(src_filename, "rb") try: try: fw = open(dst_filename, "wb") try: while True: b = fr.read(4096) if not b: break fw.write(b) finally: fw.close() except OSError: print("打开目标文件失败") finally: fr.close() except OSError: print("打开源文件失败") src = input("请输入源文件名:") dst = input("请输入目标文件:") mycopy(src, dst)
标签:final inpu 打开 print err bre error def not
原文地址:https://www.cnblogs.com/zengsf/p/9532476.html