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. PATH and CLASSPATH

    PATH and CLASSPATH 1. 可以不设置PATH直接运行Java应用的.PATH的设置只是为了使用上的方便. 2. PATH设置的是Java的bin目录,使得bin目录下的可执行程序能够 ...

  2. Bitmap: a C++ class

    Bitmap: a C++ class        The five steps involved to draw a bitmap: Load bitmap using LoadBitmap or ...

  3. springBoot 整合 RabbitMQ 的坑

    1.Consumer raised exception, processing can restart if the connection factory supports it. Exception ...

  4. C++匿名名字空间

    转自:http://blog.csdn.net/eric_arrow/article/details/8978905 名字空间(namespace),是C++提供的一个解决符合名字冲突的特性.标准规定 ...

  5. Lua 基础总结

    lua 数组下标从 1 开始, 不是 0 lua 逻辑运算符  与 或 非  就是英文  and  or  not local  局部变量 数据类型:lua是一门动态类型语言,变量没有类型,只有值才有 ...

  6. quartz (二) Spring+Quartz实现定时任务的配置方法

    JobDetail  设置执行的任务 :CronTrigger   触发器:设置执行的时间规则      ;  Scheduler    // 调度器,将任务与执行时间关联 本文转自:http://w ...

  7. SQL执行并返回执行前/后结果

    SQLServer: 1.插入数据,并返回插入的数据: INSERT INTO TestTB(Province,City) output inserted.Province, inserted.Cit ...

  8. 前端学习笔记之HTML中的id,name,class区别

    name 属性用于在 JavaScript 中对元素进行引用,或者在表单提交之后,对表单数据进行引用. html的name和id可以类比身份证的姓名和身份证编号,编号id具有唯一性,一个id只出现一次 ...

  9. spring项目gitignore

    target/ ### STS ### .apt_generated .classpath .factorypath .project .settings .springBeans ### Intel ...

  10. 20145324 《Java程序设计》第8周学习总结

    20145324 <Java程序设计>第8周学习总结 教材学习内容总结 第十四章 1.NIO使用频道来衔接数据节点,可以设定缓冲区容量,在缓冲区中对感兴趣的数据区块进行标记,提供clear ...