import math

if __name__ == '__main__':
    name1 = raw_input("请输入您的编号:")
    print name1

完整的错误信息如下:

File "D:\python\pythons\src\test.py", line 20
SyntaxError: Non-ASCII character '\xe8' in file D:\python\pythons\src\test.py on line 20, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

缺少编码类型声明:no encoding declared

修改如下:

#encoding:utf-8
import math

if __name__ == '__main__':
name1 = raw_input("请输入您的编号:")
print name1

pyhon SyntaxError: Non-ASCII character '\xe8' in file xxx on line xx, but no encoding的更多相关文章

  1. Fix Some bytes have been replaced with the Unicode substitution character while loading file XXX.cs with Chinese Simplified (GB2312) encoding

    When we use <strong>visual studio</strong> open source file or any other file, we may en ...

  2. 【Python】SyntaxError: Non-ASCII character '\xe8' in file

    遇到的第一个问题: SyntaxError: Non-ASCII character '\xe8' in file D:/PyCharmProject/TempConvert.py on line 2 ...

  3. SyntaxError: Non-UTF-8 code starting with '\xe5' in file ***.py on line 105, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for

    用charles抓包时, 对抓到的html,放到pycharm中解析, 结果报错: SyntaxError: Non-UTF-8 code starting with '\xe5' in file * ...

  4. Python保存时提示“SyntaxError: Non-ASCII character '\xe8' in file”

    原因 Python 默认的是ASCII 编码方式,如果出现中文会出现问题,所哟必须在代码的第二行或第一行 显示的声明编码方式(已注释的方式,即"#"开始) 解决方法 在文件头部加上 ...

  5. 执行python文件报错SyntaxError: Non-ASCII character '\xe8' in file, but no encoding declared

    在文件头部加上: # -*- coding: utf-8 -*

  6. python SyntaxError: Non-ASCII character '\xe8' in file C:\Users\nwpujun\PycharmProjects\projects\hrl1\hrlAgent\src\li_nn.py on line 52

    解决方法:在文件头部加上这样的一句话 # -*- coding: utf-8 -*- 注意:加在其他的位置可能没用,我就是这样的

  7. Non-ASCII character &#39;\xe8&#39; in file xxx.py on line 8, but no encoding declared

    使用网上某个python程序.编译时报错: File "xxx.py", line 8         SyntaxError: Non-ASCII character '\xe8 ...

  8. python 运行时报错误SyntaxError: Non-ASCII character '\xe5' in file 1.py on line 2

    File "1.py", line 2SyntaxError: Non-ASCII character '\xe5' in file 1.py on line 2, but no ...

  9. python 遇到 syntaxerror: non-ascii character '/xd6' in file 我 教你解决 (python问题)(转)

    遇到标题上的问题,按照我的解决广方案来吧 ===================================== (一) 用记事本创建一个文件ChineseTest.py,默认ANSI: s = ...

随机推荐

  1. Google:移动端搜索正式上线移动友好标签

    Google移动端搜索正式上线“Mobile-Friendly”(移动友好)标签,并宣布如果卖家网站上没有移动友好标签或者错误地设置移动友好标签,那么卖家的网站将被降级. Google表示目前常见的智 ...

  2. CCF 炉石传说(模拟)

    试题编号: 201612-3 试题名称: 炉石传说 时间限制: 1.0s 内存限制: 256.0MB 问题描述 <炉石传说:魔兽英雄传>(Hearthstone: Heroes of Wa ...

  3. vue-cli脚手架build目录中的webpack.base.conf.js配置文件

    转载自:http://www.cnblogs.com/ye-hcj/p/7082620.html webpack.base.conf.js配置文件// 引入nodejs路径模块 var path = ...

  4. sgu 103 Traffic Lights 解题报告及测试数据

    103. Traffic Lights Time limit per test: 0.25 second(s) Memory limit: 4096 kilobytes 题解: 1.其实就是求两点间的 ...

  5. tensorboard实现训练的可视化

    tensorboard是tensorflow自带的可视化工具 输入命令可以启动tensorboard服务. tensorboard --logdir=your log dir 通过浏览器localho ...

  6. java获得两个日期之间的所有月份

    private static List<String> getMonthBetween(String minDate, String maxDate) throws ParseExcept ...

  7. JavaScript 事件处理详解

    事件绑定与解绑: el.onEventName = function (){} document.getElementById("dom").onclick = function( ...

  8. Android事件处理下(按键、触摸屏和滚动球的一些实现细节)

    http://www.cnblogs.com/andtt/articles/2145563.html 对于按键事件,调用mDevices[i]->layoutMap->map进行映射.映射 ...

  9. windows忘记密码

    方法一 在开机时,按下F8进入”带命令提示符的安全”模式 输入”NET USER+用户名+123456/ADD”可把某用户的密码强行设置为”123456″ 方法二 如用户忘记登入密码可按下列方法解决 ...

  10. clientWidth offsetWidth scrollWidth

    网页可见区域宽: document.body.clientWidth;网页可见区域高: document.body.clientHeight;网页可见区域宽: document.body.offset ...