We recommend switching to the latest versions of Edge, Firefox, Chrome or Safari. Using Internet Explorer will result in a loss of website functionality.

Run an External Python Script from within Analyze

Follow

Comments

2 comments

  • Avatar
    BRabbit

    I am using the D3S Server version and Python 3.6 installed on my Windows PC
    Could you let me know how I could use this version to execute an external script via the D3S server?

    0
    Comment actions Permalink
  • Avatar
    Adrian Williams

    The 'Handling Errors and Other Considerations' section of the article discusses this use case:

    In the cmdArray only the name of the python command was included as it is on the default PATH. In the case where you want to run a different instance of the Python interpreter (e.g. Python 3.8) in the subprocess you will need to include the absolute path to the Python executable. You may also need to modify the PATH to align with the required locations to be searched for executable libraries,

    So instead of

        cmdArray = ['python', 'c:\\path\\to\my\\executable.py']

    you would use somthing similar to 

         cmdArray = ['c:\\path\\to\\installed\\python36\\python', 'c:\\path\\to\my\\executable.py']

    You can use the --version example included in the 'Handling Errors and Other Considerations' section to demostrate that the intended Python instance is being executed - the version number will be shown in the Errors panel 

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.