How to run Python scripts in Windows

Follow

Can I run Python Scripts on Windows with JAMS?

Absolutely. To run Python Scripts on Windows in JAMS, take the following steps:

  • Ensure Python.exe is installed in a location accessible by JAMS
  • Create a Python Execution Method
  • Use Python Script in the source of a Python Windows Job

 


Create a Python_Windows Execution Method

  1. Click on the Execution Methods shortcut.
  2. Click on the Add button (plus sign).
  3. Fill out the Name of the new Execution method.
  4. Use Command as the base method and edit the new Method after saving.
  5. Ensure the Type is set to BatchExtension is set to py and set the Command to the location of Python.exe, followed by "{0}". If Python.exe is in a non-standard location, use the full path.2018-02-28_1232.png
  6. Save and Close the Execution Method. Users may now select the new method when creating Jobs.

 


Use Python Script in the Source of a Python Windows Job

  1. Click the Add button in the Jobs section to add a new Job
  2. Name the Job as desired.
  3. Select the Python_Windows Execution Method from the drop-down list.
  4. Paste or enter the desired Python code in the Job Source
    2018-02-28_1240.png

NOTE: When referencing the location of a PY file, the Command Execution method should be used, referencing the location of python.exe and the PY file. For example:

C:\python\python.exe c:\temp\myScript.py

Have more questions? Submit a request

Comments