execl difficulty

python newbie mesteve_b at hotmail.com
Sun Dec 14 23:55:31 CET 2003


I tried that and it didn't work, but I like the direction you suggested.
Thanks, I'll figure this sucker out.
"Bengt Richter" <bokr at oz.net> wrote in message
news:briksl$oc4$0 at 216.39.172.122...
> On Sun, 14 Dec 2003 20:53:10 GMT, "python newbie" <mesteve_b at hotmail.com>
wrote:
>
> >Can anyone tell me why this would cause "Invalid Number of Parameters"
while
> >trying to compile (or interpret or whatever)
> >
> >import os
>
>os.execl("C:/WINDOWS/system32/xcopy.exe","E:/MainWeb/dreampics/*.*","E:/Mai
n
> >Web/dp")
> >
> >Here's what the Python reference says:
> >     execl(path,arg0, arg1, ...)
> >
> >if you can see something obvious, please tell me
>
> I think xcopy uses suffixed optional forward-slash switch options, so it
might be getting confused?
> I'd try (note the 'r' prefixes for raw string literals):
>
>     os.execl(r"C:\WINDOWS\system32\xcopy.exe",
r"E:\MainWeb\dreampics\*.*", r"E:\MainWeb\dp")
>
> I don't know what the length or count limits might be on expansion of
"*.*" but hopefully
> it it pretty big.
>
> Regards,
> Bengt Richter






More information about the Python-list mailing list