Calling another script using method in python script

Hi Team,
we have requirement to call script from current python call another script i’m using method."C:\Python27\python.exe" + " " + r"C:\Test\Scripts\" , shell=True)

but i’m not receiving any error nor any result and pipeline goes on executing continuously without giving any result or error.

python code :-

Import the interface required by the Script snap.

from com.snaplogic.scripting.language import ScriptHook
import java.util
import subprocess

class TransformScript(ScriptHook):
def init(self, input, output, error, log):
self.input = input
self.output = output
self.error = error
self.log = log

# The "execute()" method is called once when the pipeline is started
# and allowed to process its inputs or just send data to its outputs.
def execute(self):"Executing Transform script")
    while self.input.hasNext():
            # Read the next document, wrap it in a map and write out the wrapper
            in_doc =
            record = in_doc

  "C:\\Python27\\python.exe" + " " + r"C:\\Test\\Scripts\\"  , shell=True)"C:\\Python27\\python.exe" + " " + "C:\\Test\\Scripts\\"  , shell=True)
        except Exception as e:
            errWrapper = {
                'errMsg' : str(e.args)
            self.log.error("Error in script")
            self.error.write(errWrapper)"Finished executing the Transform script")

The Script Snap will look for a ScriptHook object in the “hook”

variable. The snap will then call the hook’s “execute” method.

hook = TransformScript(input, output, error, log)

can someone suggest what i’m doing wrong.

A couple tips you could try from looking at your script.

The first step I’d take in debugging is checking the output of the subprocess call method. You can do this using the check_output method. This will give you more information about whether the output succeeded or not and also output from executing.

Also, the call method takes a list where the first element is the command and subsequent elements are the arguments. So you could try:["C:\\Python27\\python.exe", "C:\\Test\\Scripts\\"], shell=True)

Another option for building paths that’s OS independent is to use os.path.join. That should give a valid path to the file without having to escape backslashes and all that.

Hope this helps and good luck!