为什么我在vim中粘贴这个,我得到语法错误?

TIM*_*MEX 1 python

def latlong_distance(origin, destination):
    lat1, lon1 = origin
    lat2, lon2 = destination
    radius = 6371
    dlat = math.radians(lat2-lat1)
    dlon = math.radians(lon2-lon1)    a = math.sin(dlat/2) * math.sin(dlat/2) + math.cos(math.radians(lat1)) * math.cos(math.radians(lat2)) * math.sin(dlon/2) * math.sin(dlon/2)
    c = 2 * math.atan2(math.sqrt(a), math.sqrt(1-a))
    d = radius * c
    return d * 1000
Run Code Online (Sandbox Code Playgroud)

SyntaxError:第65行的文件/tools.py中的非ASCII字符'\ xc2',但未声明编码; 有关详细信息,请参阅http://www.python.org/peps/pep-0263.html

Raf*_*ler 7

它可能是一个间距问题(\ xc2是一个空格字符),尝试和重新使用只使用空格,没有别的.您也可以放在# -*- coding:utf-8 -*-文件的顶部,看看是否有帮助.