| Author |
file not found when calling execfile function
|
Dave Patrick
Greenhorn
Joined: May 23, 2011
Posts: 2
|
|
Hi,
I am trying to execute the following code from Java:
I have a python script called SendGridEnvelope.py that gets packaged in my WAR under WEB-INF/classes.
I keep getting a file not found exception because the execfile function is looking for the Python script under my Jboss/bin directory. I am using Jython by the way.
Does anyone know why the execfile method is looking for the python script in the Jboss/bin dir and how to change this?
Thanks,
David
|
 |
Matt Cartwright
Ranch Hand
Joined: Aug 25, 2008
Posts: 149
|
|
'execfile(String arg0)' searches the current working directory, you need to specify the absolute path and I always add the extension (.py)...
you could open the file as a java.io.InputStream and pass it to 'execfile(InputStream arg0)'
HTH
Matt
|
 |
 |
|
|
subject: file not found when calling execfile function
|
|
|