problem with spawnle

Anoop P B anoop79 at myrealbox.com
Sun Jun 30 18:09:47 EDT 2002


Hi,

	I am trying to call a java application through my python script on 
windows. After consulting the documentation, i quickly learnt that the 
os.spawn*p versions are not available on windows. so, i tried the following:

os.spawnle(os.P_NOWAIT, "java.exe", "java", "testProg", "testParam", 
os.environ)

As I understand, this should work by picking up the path system variable 
  from os.environ for setting up the environment for the new process (or 
am I missing something here?). But what I get is....

Traceback (most recent call last):
   File "server.py", line 48, in ?
     ct.run()
   File "server.py", line 25, in run
     os.spawnle(os.P_NOWAIT, "java.exe", "java", "testProg", 
"testParam",  os.environ)
   File "c:\python22\lib\os.py", line 541, in spawnle
     return spawnve(mode, file, args[:-1], env)
OSError: [Errno 2] No such file or directory

Can someone please throw some light on possible solutions to this 
problem. My ultimate aim is only to run the java program through my 
python script. However, I cannot use os.system() since my python program 
gets blocked which is not acceptable. I need my python script to call 
the java program and continue executing.

Thanks in advance,
Anoop

note: the java class is in the same directory in which my python script lies






More information about the Python-list mailing list