Excute python script throgh groovy script using job DSL
<p>Referring to the document:
<a href="https://jenkinsci.github.io/job-dsl-plugin/#path/freeStyleJob-steps-python" rel="nofollow">https://jenkinsci.github.io/job-dsl-plugin/#path/freeStyleJob-steps-python</a>
I am trying to configure my job automatically through groovy.
The job will execute a python code piece. Something like this:</p>

<pre><code>import os
from Reporting.MSTest import MSTest
jsonFile = os.path.join(os.getenv('temp')
</code></pre>

<p>Here is the code snippet. Which will add above python script in the job build steps</p>

<pre><code># the job name is "jobName"
jobA = freeStyleJob("jobName")
jobA.with {
    steps {
        python {
            command(String 'import os')
        }
    }
}
</code></pre>

<p>It not working. Please help!</p>