文件管理-Python
# f = open(r'D:\day03\笔记', 'r', encoding='utf-8')
# print(f.read())
# f.close()
# 读写图片
# # 读取二进制数据
# with open(r'D:\day03\妹子图.jpg', 'rb') as f:
# res = f.read()
# print(res)
#
#
# # 将读取出来的图片数据,写入一个新的文件中, 该文件后缀也必须是 .jpg
# with open(r'D:\day03\meizitu.jpg', 'wb') as f:
# f.write(res)
# 读写视频
# 读取二进制数据
# with open(r'D:\day03\昨日回顾.mp4', 'rb') as f:
# res = f.read()
# 将读取出来的图片数据,写入一个新的文件中, 该文件后缀也必须是 .jpg
# with open(r'D:\day03\new_video.mp4', 'wb') as f:
# f.write(res)
# 读取大文件需要 一点一点读取
# with open(r'D:\day03\0 昨日回顾.mp4', 'rb') as f:
# number = 1
# for line in f: # f也是一个可迭代对象
# print('=' * 100)
# print(line, number)
# number += 1
人的一生或多或少都在为一些事情努力着,有目标的人生是精彩的!朋友请不要在原地画圈圈,该行动了!