Manning's Countdown to 2014
. Use discount code crdotd14 all month for 50% off every deal.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
file not found when calling execfile function
Joined: May 23, 2011
May 23, 2011 00:26:08
I am trying to execute the following code from Java:
PythonInterpreter pyInter = new PythonInterpreter(); pyInter.execfile("SendGridEnvelope");
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?
Joined: Aug 25, 2008
Jul 05, 2011 19:44:21
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
and pass it to 'execfile(
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
subject: file not found when calling execfile function
AttributeError when calling pyhton scripts from java class
Calling python function from java
Help - How to I tell java where my jython.py script is located in the Directory
Executing Jython script from java and accessing resulting object
How to call a Python method form Java class
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013