Python not calling Jython using 'subprocess' module
Question: I'm trying to call a Jython script from a Python file.

I've the **Jython file:`testing.py`**, which contains:

    
    
    print "Hello"
    

Then, I've the **Python file`caller.py`** that contains:

    
    
    import subprocess
    subprocess.call(['jython', 'testing.py'])
    

If I execute the python file that calls the jython script, I get an error:

    
    
    Traceback (most recent call last):
      File "C:\Documents and Settings\Administrador\workspace\Interfaz\bashpython.py", line 3, in <module>
        subprocess.call(['jython', 'testing.py'])
      File "C:\Python27\lib\subprocess.py", line 486, in call
        return Popen(*popenargs, **kwargs).wait()
      File "C:\Python27\lib\subprocess.py", line 672, in __init__
        errread, errwrite)
      File "C:\Python27\lib\subprocess.py", line 882, in _execute_child
        startupinfo)
    WindowsError: [Error 2] El sistema no puede hallar el archivo especificado
    

The thing is that if I change the caller.py function to call it to another
Python function instead of a Jython one, works perfectly (it prints the
`Hello`string):

    
    
    import subprocess
    subprocess.call(['python', 'testing.py'])
    

I'm using Eclipse Standard 4.3.1. and PyDev.  
Thanks in advance


Answer: If `testing.py` and `caller.py` are in same folder then the above code should
work. But if they are not in same location then it is obvious that you have to
provide the location of the file.

I have `caller.py` in `/home/reuben/caller.py` and `testing.py` in
`/home/reuben/Documents/testing.py` . And I have given the full path of
testing.py in caller.py.

    
    
    subprocess.call(['jython', '/home/reuben/Documents/testing.py'])
    

And all that is working for me.

