Moving around files and fun things of that sort.
marklists at mceahern.com
Tue Aug 27 14:48:36 EDT 2002
> x = 0
> for x in range (17):
fwiw, if you have a list, you can enumerate it without the range stuff;
seq = ['a', 'b', 'c']
for letter in seq:
Now, if you have source and destination, consider storing them like so:
def __init__(self, source, destination):
self.source = source
self.destination = destination
files = 
> os.system('cp -p source[x] destination[x]')
> if os.path.getsize(source[x]) != os.path.getsize(destination[x]):
> print 'Size not verified, do you wish to contnue?'
> (this is pseudo-code, so don't worry about specific syntax)
> my problem is this will not work with the os.system method. There
> isn't a way that I can find that will allow me to mix these arrays
> with the system command. So a) is there a way for python to copy the
> files w/o using the os.system, or is there a way to make os.system
source = 'foo'
destination = 'bar'
cmd = 'cp -p %s %s' % (source, destination)
Does that help?
More information about the Python-list