[Day19]-档案读取与写入

  • 写入档案
  1. 写入空文件内
    https://ithelp.ithome.com.tw/upload/images/20211001/201406445oHxGWOg9J.png
    https://ithelp.ithome.com.tw/upload/images/20211001/20140644EXM8POBTpI.png
    https://ithelp.ithome.com.tw/upload/images/20211001/201406441UdiaeEfQo.png
  2. 档案很大时分段写入
    https://ithelp.ithome.com.tw/upload/images/20211001/201406442m7bpI8fOm.png
    https://ithelp.ithome.com.tw/upload/images/20211001/20140644dFdsYgH3Ep.png
    https://ithelp.ithome.com.tw/upload/images/20211001/20140644RkypQRCOIX.png
  • Shutil模组
    档案或目录的复制、移动、更改和删除,使用时要先import shutil
  1. 档案复制copy()与目录复制copytree()
    https://ithelp.ithome.com.tw/upload/images/20211001/20140644R2UXB4sVdk.png
  2. 目录跟档案的移动move()
    https://ithelp.ithome.com.tw/upload/images/20211001/20140644PZsRAYThTW.png
  3. 目录跟档案的更改move()
    https://ithelp.ithome.com.tw/upload/images/20211001/20140644TdDZB8pGAA.png
  4. 安全删除档案与资料夹send2trash() 但使用前要先下载外部模组
    pip install send2trash
    https://ithelp.ithome.com.tw/upload/images/20211001/20140644iQlZV9GjT0.png
  • 档案压缩与解压缩zipfile
  1. 压缩资料夹
    https://ithelp.ithome.com.tw/upload/images/20211001/20140644Kphz2i9TKX.png
  2. 读取zip档案
    https://ithelp.ithome.com.tw/upload/images/20211001/201406447rQnXYCgAz.png
  • 小实作—加密档案
    https://ithelp.ithome.com.tw/upload/images/20211001/20140644k02nCJkIfq.png
    https://ithelp.ithome.com.tw/upload/images/20211001/20140644RdGUttBkUa.png

<<:  D3JsDay16 It's map birth,It's from path—生成地图

>>:  [D16] CNN应用

qrcode 的 generate和decode(python)

generate: import qrcode import argparse def make_q...

Day 29 架设 Apache

Day 29 架设 Apache 其实介绍到今天简单架设一下 Apache,让虚拟机当作是一台服务器...

居家必备良药的生存之道

即便政府三令五申不得将成药或保健药品夸大疗效,各大药厂似乎都阳奉阴违,因为实在没办法,这块市场的大饼...

Day 27 [其他05] 前端必知必会--操作URL的黑科技

文章选自 作者:小华坚决上王者 连接:https://juejin.im/post/68449038...

Angular 深入浅出三十天:表单与测试 Day27 - Reactive Forms 进阶技巧 - 跨栏位验证

今天想要跟大家分享的是跨栏位验证的小技巧,这个小技巧其实没有多厉害或多特别,只是可能满多人刚好不知...