Re: Newbie Copy Question
From: Stacy (stacycollings_at_yahoo.com)
Date: 06/10/04
- Next message: David Fisher: "Re: My simple script parse output screen and to a new file!"
- Previous message: chuck amadi: "Re: UML Tools"
- In reply to: Peter Hansen: "Re: Newbie Copy Question"
- Next in thread: Peter Hansen: "Re: Newbie Copy Question"
- Reply: Peter Hansen: "Re: Newbie Copy Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 9 Jun 2004 17:01:29 -0700
Thanks for the response, Peter! Another reader helped me out, too,
but I figured out what the problem was...the folders and file names
are case-sensitive! Once I changed documents and settings...blah blah
blah to Documents and Settings blah blah blah it worked just fine.
I'm doing some computer migrations at work and I wanted to write a
frozen binary to copy all the important files automatically to my jump
drive for transfer to the new PC. BTW a jump drive is just a USB
thumb drive that I use to copy stuff from the old computers to the new
:)
Thanks again,
Stacy
Peter Hansen <peter@engcorp.com> wrote in message news:<fbednShX56BA01rdRVn-hg@powergate.ca>...
> Stacy wrote:
>
> > I'm new to Python (about 2 weeks) and I want to use the shutil module
> > to copy files from Windows XP folders to my jump drive. My problem is
> > that I can't figure out how to make Python deal with the spaces in
> > Windows folder and file names. I tried putting the path in quotes
> > (like you do at a DOS prompt) but still no good. I searched
> > python.org and can't find an answer....any ideas?
>
> Please post an example of the paths that aren't working. Spaces
> generally work fine, but perhaps the limitation is with your
> "jump drive" (what's that?) rather than with Python itself.
> Another possibility is that you are using single backslashes
> inside the Python strings, without realizing the effect this
> has when certain characters follow the backslash... this is
> because of the "escape sequences" allowed in strings to let
> a programmer produce special characters such as TAB (\t) or
> LF (\n). If that's the case, switching to forward slashes
> should work, or learn to use raw strings as in r'path\file'.
>
> -Peter
- Next message: David Fisher: "Re: My simple script parse output screen and to a new file!"
- Previous message: chuck amadi: "Re: UML Tools"
- In reply to: Peter Hansen: "Re: Newbie Copy Question"
- Next in thread: Peter Hansen: "Re: Newbie Copy Question"
- Reply: Peter Hansen: "Re: Newbie Copy Question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|