i have some of the basics down for Python, but i've been working on a simple program that backs up music and pics from My Documents onto my external. i have the program working more or less. but what i'm looking to do ultimately is making the program look for a previous backup on the external, if there is, delete it and continue backing up the music/pictures. for the copy i've been using shutil.copytree since it copies sub directories. Any advice would be great : )
I've been working on this on my Mac at work, so the source/destination is set on Mac, but i'm going to be using it on my Windows desktop, so any advice i would love it to be focused on windows.
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()

New Topic/Question
Reply




MultiQuote







|