# Passing jenkins "parameters" to python subprocess module

**URL:** <https://community.jenkins.io/t/passing-jenkins-parameters-to-python-subprocess-module/9609>\
**Category:** Using Jenkins\
**Created:** [September 14, 2023, 11:15pm UTC](https://community.jenkins.io/t/passing-jenkins-parameters-to-python-subprocess-module/9609 "2023-09-14T23:15:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hettin](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/hettin/32/5244_2.png) [@hettin](https://community.jenkins.io/u/hettin)\
**Post date:** [September 14, 2023, 11:15pm UTC](https://community.jenkins.io/t/passing-jenkins-parameters-to-python-subprocess-module/9609/1 "2023-09-14T23:15:44Z")

</div>

Jenkins setup:

## Jenkins: 2.401.2 OS: Linux - 5.4.0-156-generic Java: 11.0.19 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)

 ![jenkins-parameters](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/6/63e0ac9cf02ac010a196d921e55051c5ab976071.jpeg)

How can I pass a parameter named “FILENAME” that is defined under jenkins “This project is parameterized” inside of a python script? The script is like the one below:

$ cat python-script.py  
#!/usr/bin/python3  
import os  
import subprocess  
result = subprocess.run([“ls”, “$FILENAME”])  
result

Here the script should run “ls -l /etc/passwd”

Regards,  
Niranjan

---

<div class="post-metadata">

**Author:** ![mawinter69](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/mawinter69/32/1625_2.png) [@mawinter69](https://community.jenkins.io/u/mawinter69)\
**Post date:** [September 14, 2023, 11:46pm UTC](https://community.jenkins.io/t/passing-jenkins-parameters-to-python-subprocess-module/9609/2 "2023-09-14T23:46:41Z")

</div>

Parameters are available as environment variables
