Created
July 16, 2023 09:10
-
-
Save exemplum100/cf3caedb5215482e9e0e9c89d8bc7355 to your computer and use it in GitHub Desktop.
Zip something
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import shutil | |
import pprint | |
from datetime import datetime | |
#upd stamp | |
with open("lastupd.txt", "a") as f: | |
x = datetime.today().strftime('%Y-%m-%d %H:%M:%S') | |
f.write(x + '\n') | |
f.close | |
#del old dir from copy stage | |
try: | |
shutil.rmtree('./DescArc') | |
except: | |
pass | |
#Copy dir (from/to) | |
shutil.copytree('../PyDir', './DescArc') | |
print('\nAFTER:') | |
pprint.pprint(os.listdir('./DescArc')) | |
#zip it! | |
shutil.make_archive('DescSendArc', 'zip', 'DescArc') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment