资源简介
Python快速上手经典教程
代码片段和文件信息
import os
import time
# 1. The files and directories to be backed up are
# specified in a list.
# Example on Windows:
# source = [‘“C:\\My Documents“‘]
# Example on Mac OS X and Linux:
source = [‘/Users/swa/notes‘]
# Notice we have to use double quotes inside a string
# for names with spaces in it. We could have also used
# a raw string by writing [r‘C:\My Documents‘].
# 2. The backup must be stored in a
# main backup directory
# Example on Windows:
# target_dir = ‘E:\\Backup‘
# Example on Mac OS X and Linux:
target_dir = ‘/Users/swa/backup‘
# Remember to change this to which folder you will be using
# 3. The files are backed up into a zip file.
# 4. The name of the zip archive is the current date and time
target = target_dir + os.sep + \
time.strftime(‘%Y%m%d%H%M%S‘) + ‘.zip‘
# Create target directory if it is not present
if not os.path.exists(target_dir):
os.mkdir(target_dir) # make directory
# 5. We use the zip command to put the files in a zip archive
zip_command = ‘zip -r {0} {1}‘.format(target
‘ ‘.join(source))
# Run the backup
print(‘Zip command is:‘)
print(zip_command)
print(‘Running:‘)
if os.system(zip_command) == 0:
print(‘Successful backup to‘ target)
else:
print(‘Backup FAILED‘)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 0 2021-01-21 06:14 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?
文件 312 2021-01-21 06:14 __MACOSX\._A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?
文件 6148 2021-01-28 02:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?.DS_Store
文件 120 2021-01-28 02:10 __MACOSX\A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?._.DS_Store
目录 0 2021-01-21 06:14 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\
文件 220 2021-01-21 06:14 __MACOSX\A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?._byte-of-python-master
文件 2246672 2018-02-24 20:50 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-chinese-edition.pdf
文件 276 2018-02-24 20:50 __MACOSX\A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?._byte-of-python-chinese-edition.pdf
文件 2573227 2018-02-24 20:56 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master.zip
文件 276 2018-02-24 20:56 __MACOSX\A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?._byte-of-python-master.zip
文件 15919 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\oop.md
文件 7050 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\exceptions.md
文件 16893 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\data_structures.md
文件 16553 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\basics.md
文件 8048 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\more.md
文件 6148 2021-01-28 02:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\.DS_Store
文件 120 2021-01-28 02:10 __MACOSX\A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\._.DS_Store
文件 3760 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\floss.md
文件 559 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\dedication.md
文件 807 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\SUMMARY.md
文件 101 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\Makefile
文件 503 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\book.json
文件 4800 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\stdlib.md
文件 95 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\poem.txt
文件 675 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\translation_howto.md
文件 12199 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\modules.md
文件 94 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\INSTALL.md
文件 20447 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\README.md
目录 0 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\img\
目录 0 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\programs\
文件 12579 2018-01-28 05:10 A Byte of Python(绠€鏄嶱ython鏁欑▼)(绗?鐗?涓枃鐗?byte-of-python-master\problem_solving.md
............此处省略115个文件信息
- 上一篇:Python实例174946
- 下一篇:基于Python的学生管理系统
相关资源
- 基于Python的学生管理系统
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
- 量化交易(附python常见函数的使用方
- python 名字用字排行
- Python串口通信(pyserial)
- python读取nfc卡
- 近百条常用有用的python语句
- Python数据结构.pdf60078
- python实现香农编码
评论
共有 条评论