# Python Script in Automator

**URL:** <https://community.unix.com/t/python-script-in-automator/294333>\
**Category:** macOS\
**Created:** [August 28, 2011, 2:12pm UTC](https://community.unix.com/t/python-script-in-automator/294333 "2011-08-28T14:12:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiphiasxvii](https://community.unix.com/letter_avatar/xiphiasxvii/32/6_449c533f586939b6e5f246632a46421f.png) [@xiphiasxvii](https://community.unix.com/u/xiphiasxvii)\
**Post date:** [August 28, 2011, 2:12pm UTC](https://community.unix.com/t/python-script-in-automator/294333/1 "2011-08-28T14:12:10Z")

</div>

So I wrote a python script to automatically remove torrents from transmission using transmissionrpc. If I run the script manually in terminal using 'python /pathname/tc.py' where pathname is the path to the file, it works fine. However, I want to set it up as a folder action in automator. I added a Run Shell Script action to my workflow with /bin/bash as the shell and Pass input set to stdin. I put the same command in but when I run the workflow, I receive the following error:

Run Shell Script failed - 1 error  
Traceback (most recent call last):

As far as I can tell from scouring the web it has to do with the Run Shell Script action's shell not having access to the same things as the default terminal shell. Unfortunately I have no idea how to fix this...  
Any advice would be awesome. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![codecaine](https://community.unix.com/letter_avatar/codecaine/32/6_449c533f586939b6e5f246632a46421f.png) [@codecaine](https://community.unix.com/u/codecaine)\
**Post date:** [January 15, 2012, 11:27pm UTC](https://community.unix.com/t/python-script-in-automator/294333/2 "2012-01-15T23:27:43Z")

</div>

You have to use the full path of your python compiler. For example /usr/bin/python or you can add the shebang line in you python script #!/usr/bin/python

---------- Post updated at 12:27 AM ---------- Previous update was at 12:25 AM ----------

Here is an example I did using shell script in automator. [Running Windows Programs By Double Clicking on it On Mac OS X - YouTube](http://www.youtube.com/watch?v=N853_I1wI20)
