سلام دوستان من میخوام یه برنامه بنویسم که بتونه از مسیر پیش فرضی پشتیبان بگیره و در مسیر پیش فرضی ذخیره کنه ! حالا این کدی که گذاشتم فیلتر روی فایلها هم میذاره
میشه دوستان چک کنن و اگه ایده برای کامل شدن این کد دارن منو راهنمایی کنن ؟


import os
import sys
from time import sleep
import shutil

def start():
print 'This is the backup program'
sleep(2)
print 'What will you back up?'
print '1) Pictures'
print '2) Music'
print '3) Quit'
selection = input()
if selection == (1):
pictures()
if selection == (2):
music()
if selection == (3):
exit.sys
else:
print 'incorrect selection'
sleep(2)
start()
def pictures():
print 'pictures it is'
sleep(2)
shutil.copytree('/Users/Minerva/Pictures', '/Users/Minerva/Desktop/Pictures')
print 'copy completed'
start()
def Music():
print 'Music it is'
sleep(2)
shutil.copytree('/Users/Minerva/Music', '/Users/Minerva/Desktop/Music')
print 'copy completed'
start()
start()

دوستان کسی در مورد اجرای این کدها راهنمایی میتونه به من برسونه؟

import os
import time

source = ['"C:\\My Documents"']
target_dir = 'E:\\Backup'
today = target_dir + os.sep + time.strftime('%Y%m%d')
now = time.strftime('%H%M%S')
comment = input('Enter a comment -->')
if len(comment) == 0:
target = today +os.sep + now + '.zip'
else:
target = today + os.sep + now + '_' + \
comment.replace(' ', '_') + '.zip'

if not os.path.exists(today):
os.mkdir(today)
print('Successfully created directory', today)

zip_command = "zip -qr {0} {1}".format(target, ' '.join(source))

if os.system(zip_command) == 0:
print('Successful backup to', target)
else:
print('Backup FAILED')