0 Members and 1 Guest are viewing this topic.
import os, sys, glob, shutil, fnmatchmatches = []for root, dirnames, filenames in os.walk(sys.argv[1]): for filename in fnmatch.filter(filenames, '*.h'): matches.append(os.path.join(root, filename)) for filename in fnmatch.filter(filenames, '*.txt'): matches.append(os.path.join(root, filename))print(matches)dest=sys.argv[2]for f in matches: keep=input("Do you want to keep "+f) if keep=='': keep = old if keep=='r' or keep=='n': os.remove(f) elif keep=='k' or keep=='y': print(dest+os.path.split(f)[1]) shutil.copy(f,dest+os.path.split(f)[1]) else: print("You need to use a valid command y/k keep or r/n remove") old = keep
Ok, how the hell is this possible, when doing a backup of my other files i randomley looked at the terminal output - and aparently my desktop got moved into my jedi academy source folder HOW THE HAY is that possible Anyways, the good news is that i still have all the files then!
Quote from: Sorunome on November 11, 2013, 12:34:59 pmOk, how the hell is this possible, when doing a backup of my other files i randomley looked at the terminal output - and aparently my desktop got moved into my jedi academy source folder HOW THE HAY is that possible Anyways, the good news is that i still have all the files then! I told'ya, after a couple of scary days you just might get lucky! Good to hear. Now you can get some extra sleep.