title: Changing python file permission with chmod +x
body: <p>I'm a definite Python newbie, so the answer here may be obvious. But I'm trying to change a simple .py file's permissions so it can be run directly from the Terminal window (I'm running Python3 from a Macbook). I've entered the shebang line <code>#! /usr/bin/env python3</code> at the top of my script, but according to the tutorial I'm following, I next need to run the following command: </p>
  
  <pre><code>chmod +x pythonScript.py 
  </code></pre>
  
  <p>But every time I try running this either from Terminal or the Python shell, I get the following syntax error:</p>
  
  <pre><code>&gt;&gt;&gt; chmod +x pythonScript.py
    File "&lt;stdin&gt;", line 1
      chmod +x pythonScript.py
                          ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>Any ideas on what I'm missing? How do I change the file permission so I can execute a file directly from the Terminal window?</p>