1.安装Python2.7版本,通过pyCharm输入end语句报错如下:

python的endpoint函数作用 python中end函数出错_python

 

 报错原因:

end是python3.X的语法,对应python2.X版本中运行编码时,导入   from __future__ import print_function即可。

python的endpoint函数作用 python中end函数出错_python_02

 

 结果如下:

python的endpoint函数作用 python中end函数出错_python_03

 

 注意需要将 #coding:utf-8 写入,转码输出中文