title: "cannot execute binary file" error in python
body: <p>I keep getting the following error:</p>
  
  <pre><code>$ ./test.py
  -bash: ./test.py: cannot execute binary file
  </code></pre>
  
  <p>when trying to run the following file in python via cygwin:</p>
  
  <pre><code>#!usr/bin/python
  with open("input.txt") as inf:
      try:
          while True:
              latin = inf.next().strip()
              gloss = inf.next().strip()
              trans = inf.next().strip()
              process(latin, gloss, trans)
              inf.next()    # skip blank line
      except StopIteration:
          # reached end of file
          pass
  from itertools import chain
  
  def chunk(s):
      """Split a string on whitespace or hyphens"""
      return chain(*(c.split("-") for c in s.split()))
  
  def process(latin, gloss, trans):
      chunks = zip(chunk(latin), chunk(gloss))
  </code></pre>
  
  <p>How do I fix this??</p>
  
  <hr>
  
  <p>After taking on the below suggestions, still getting the same error. </p>
  
  <p>If this helps, I tried</p>
  
  <pre><code>$ python ./test.py
  </code></pre>
  
  <p>and got </p>
  
  <pre><code>$ python ./test.py
    File "./test.py", line 1
  SyntaxError: Non-ASCII character '\xff' in file ./test.py on line 1, but no encoding     declared; see http://www.python.org/peps/pep-0263.html for details
  </code></pre>