Daniel Bickett wrote:
Hello,
I'm writing an application in my pastime that moves files around to
achieve various ends -- the specifics aren't particularly important.
The shutil module was chosen as the means simply because that is what
google and chm searches returned most often.
My problem has to
Daniel Bickett wrote:
In my script, rather than a file being moved to the desired location,
it is, rather, moved to the current working directory (in this case,
my desktop -- without any exceptions, mind you). As it happens, the
what is the output generated by the lines:
fdir, fname = randFileInfo.
Daniel Bickett wrote:
As it happens, the
desired locations are system folders (running windows xp, the folders
are as follows: C:\WINDOWS, C:\WINDOWS\SYSTEM, C:\WINDOWS\SYSTEM32).
To see if this factor was causing the problem, I tried it using the
interpreter, and found it to be flawless.
I'm not e
Don wrote:
> I don't know if this is the problem or, not, but:
> [snip]
As I said, that was simply an error when typing the example, and it is
not present in my code. See below.
Neil Benn wrote:
> >Oh, I'm sorry, that was my mistake. The example contained that error,
> >but my code does not.
> >
I don't know if this is the problem or, not, but:
shutil.move( "C:\omg.txt" , "C:\folder\subdir" )
Needs to have some special handling for the backslashes.
Either:
shutil.move( r"C:\omg.txt" , r"C:\folder\subdir" )
or:
shutil.move( "C:\\omg.txt" , "C:\\folder\\subdir" )
-Don
Daniel Bicket
Daniel Bickett wrote:
Oh, I'm sorry, that was my mistake. The example contained that error,
but my code does not.
Daniel Bickett
To be fair though - I would have expected the method to throw an error
rather than default to cwd.
Neil
--
Neil Benn
Senior Automation Engineer
Cenix BioScience
BioI
Oh, I'm sorry, that was my mistake. The example contained that error,
but my code does not.
Daniel Bickett
--
http://mail.python.org/mailman/listinfo/python-list
"Delaney, Timothy C (Timothy)" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Daniel Bickett wrote:
> > shutil.move( "C:\omg.txt" , "C:\folder\subdir" )
^ ^^ ^
> The problem is that backslash is the escape character. In particular,
> '\f' is
Daniel Bickett wrote:
> shutil.move( "C:\omg.txt" , "C:\folder\subdir" )
^ ^^ ^
The problem is that backslash is the escape character. In particular,
'\f' is a form feed.
>>> '\o'
'\\o'
>>> '\f'
'\x0c'
>>> '\s'
'\\s'
Notice how for '\o' and '\s' it doub
Hello,
I'm writing an application in my pastime that moves files around to
achieve various ends -- the specifics aren't particularly important.
The shutil module was chosen as the means simply because that is what
google and chm searches returned most often.
My problem has to do with shutil.move
10 matches
Mail list logo