Я продолжаю получать следующую ошибку:
$./test.py
-bash:./test.py: cannot execute binary file
при попытке запустить следующий файл в python через cygwin:
#!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))
Как мне это исправить??
Приняв во внимание приведенные ниже предложения, все еще получаю ту же ошибку.
Если это поможет, я попробовал
$ python./test.py
и получил
$ 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