# State Scripts

**URL:** https://hub.mender.io/t/state-scripts/2400
**Category:** General Discussions
**Created:** [September 7, 2020, 11:23am UTC](https://hub.mender.io/t/state-scripts/2400 "2020-09-07T11:23:04Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![SamanRatna](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@SamanRatna](https://hub.mender.io/u/SamanRatna)
#### Post date: [September 7, 2020, 11:23am UTC](https://hub.mender.io/t/state-scripts/2400/1 "2020-09-07T11:23:04Z")

</div>

Does mender state script execute in python 2 or python 3?

My script executes in python3 my\_script.py but not in python my\_script.py. How should I resolve this ?

---

<div class="post-metadata">

### Author: ![kacf](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/kacf/32/146_2.png) [@kacf](https://hub.mender.io/u/kacf)
#### Post date: [September 8, 2020, 6:14am UTC](https://hub.mender.io/t/state-scripts/2400/2 "2020-09-08T06:14:57Z")

</div>

Which interpreter is used to run the script depends on the first line in the file. Set the first line to

```bash
#!/usr/bin/python2

```

or

```bash
#!/usr/bin/python3

```

to specify which one to run with. This is not specific to Mender. It’s the standard UNIX way of doing things.

---

<div class="post-metadata">

### Author: ![SamanRatna](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@SamanRatna](https://hub.mender.io/u/SamanRatna)
#### Post date: [September 8, 2020, 6:38am UTC](https://hub.mender.io/t/state-scripts/2400/3 "2020-09-08T06:38:45Z")

</div>

thanks @kacf
