I am trying to make a python script executable. The script is an testHelloWorld.py
#!/usr/bin/env python
print 'Hello World'
I have made it executable by running
chmod +x testHelloWorld.py
$ python testHelloWorld.py
prints "Hello World". But $ ./testHelloWorld.py
doesn't do anything.
What am I missing here?
I am using a Mac Os X device and its running Python 2.7.5.
I have gone through the answers for earlier questions and have checked for mistakes, but still no luck. This is one such similar post - how to make python script self-executable