On Wed, May 13, 2009 at 3:58 AM, Alan Gauld wrote:
> or for platform independance:
>
> os.sep.join([src,fnames])
or os.path.join(src, fnames)
Kent
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Alan Gauld wrote:
"David" wrote
Forwarded to the list, I would also like to understand the forward slash;
os.system("mv %s/%s %s" % (src, fnames, dst))
The slash separates the file path, src, from the filename.
Thus if src is /foo/bar/baz
and fnames is spam
then %s/%s becomes
/foo/bar/b
"David" wrote
Forwarded to the list, I would also like to understand the forward slash;
os.system("mv %s/%s %s" % (src, fnames, dst))
The slash separates the file path, src, from the filename.
Thus if src is /foo/bar/baz
and fnames is spam
then %s/%s becomes
/foo/bar/baz/spam
Another wa
"Matt Herzog" wrote
os.renames happily renames the source directory, but that's not what I
want.
Any other suggestions?
You still haven't said why you can't use shutil.move()
move() uses rename if appropriate or copies/deletes if not.
It makes moving much more reliable and saves you a lot
On Tue, May 12, 2009 at 1:51 PM, Matt Herzog wrote:
> On monday I posted the below code:
>
> def schmove(src,dst):
> ... src = '/home/datasvcs/PIG/cjomeda_exp/'
> ... dst = '/home/datasvcs/PIG/cjomeda_exp_archive/'
> ... listOfFiles = os.listdir(src)
> ... for filez
David wrote:
Subject:
[Tutor] simply moving files
From:
Matt Herzog
Date:
Tue, 12 May 2009 13:51:36 -0400
To:
Python List
To:
Python List
On monday I posted the below code:
def schmove(src,dst):
... src
On monday I posted the below code:
def schmove(src,dst):
... src = '/home/datasvcs/PIG/cjomeda_exp/'
... dst = '/home/datasvcs/PIG/cjomeda_exp_archive/'
... listOfFiles = os.listdir(src)
... for filez in listOfFiles:
... os.system("mv"+ " " + src + " " +