R: [Tutor] os.spawnv OSError errno 2 No such file or directory

Marcel Preda pm@dis.ro
Thu, 13 Jul 2000 10:41:35 +0200

> On win98, with python 1.5.2 for win32, I'm trying to run os.spawnv
> (and/or os.spawnve), and I get an
> OSError: [Errno 2] No such file or directory
> I assume it's referring to the command file I'm trying to run, or
> possibly the command processor (command.com), but I can't get it
> past this error!  Even if I just try to run command.com and give it an
> absolute path name.
> Incidentally, os.system( ) works ok, but I need a longer, more flexible
> command line, so I thought spawn would be the solution.
> Here's one example of what i've tried.
> t = ['c:\\', "/w", "/p"]
> mycmd = 'ls.bat'
> import os
> os.spawnv(os.P_WAIT, mycmd, t)
> Traceback (innermost last):
>   File "<pyshell#4>", line 1, in ?
>     os.spawnv(0, mycmd, t)
> OSError: [Errno 2] No such file or directory

Maybe is better to put the complet path to the  batch file
this must be the reason