Update tellurium.py
Updated runTool, to run external apps from telluriumTools
@@ -160,21 +160,24 @@ def readFromFile(filePath):
return string
-def runTool (toolFileName):
- """
- Call an external application called toolFileName
- Note that .exe extension may be omitted for windows applications.
- Include any arguments in arguments parameter.
+def runTool (toolFileName):
+ # """
+ # Call an external application called toolFileName
+ # NOte that .exe extension may be omitted for windows applications.
- Example:
- returnString = te.runTool (['myplugin', 'arg1', 'arg2'])
+ # Include any arguments in arguments parameter.
- If the external tool writes to stdout, this will be captured by this call.
- """
+ # Example:
+ # returnString = te.runTool (['myplugin', 'arg1', 'arg2'])
+ #
+ # If the external tool writes to stdout, this will be captured by this call.
+ # """
try:
- if (os.name == 'nt') and (not toolFileName[0].endswith ('.exe')):
- toolFileName[0] = toolFileName[0] + '.exe'
+ p = os.path.dirname(sys.executable)
+ root, waste = os.path.split (p)
+ #if (os.name == 'nt') and (not toolFileName[0].endswith ('.exe')):
+ toolFileName[0] = root + '\\telluirumTools\\' + toolFileName[0] + '\\' + toolFileName[0] + '.exe'
return subprocess.check_output(toolFileName)
except subprocess.CalledProcessError as e:
