Python学习笔记之疑问 6:#coding=utf-8 与#-*- coding: utf-8 -*-的区别
2013-10-05 21:57
696 查看
在很多地方看到 #-*- coding: utf-8 -*- 这种写法,不知道他们有什么区别。
实际上,对于编译器来说,他们是一样的,区别在于他们对不同的编辑器对他的识别可能有问题。
常用的方法:
实际上,对于编译器来说,他们是一样的,区别在于他们对不同的编辑器对他的识别可能有问题。
常用的方法:
placed into the source files either as first or second line in the file, such as: # coding=<encoding name> or (using formats recognized by popular editors) #!/usr/bin/python # -*- coding: <encoding name> -*- or #!/usr/bin/python # vim: set fileencoding=<encoding name> :
相关文章推荐
- Python学习笔记 --- utf-8与utf-8-sig 两种编码格式区别
- Python学习笔记之疑问 8:Python 中的问号表达式
- python3.4学习笔记(四) 3.x和2.x的区别,持续更新
- Python学习笔记之疑问 3:''' 三重引号(three double-quotes)的作用
- Python学习笔记之疑问 9:如何使用For语句
- Flex+IIS与Flex+Visual Studio中输出Word文档的区别与疑问(学习笔记)
- Python学习笔记之疑问10:如何使用分隔符连接list中的字符串
- Python学习笔记015——readline与readlines的区别
- Python学习笔记之疑问 7:自定义模块放在什么位置
- Python学习笔记 -- input()和raw_input()的区别
- Python学习笔记之疑问 4:什么是模块
- python学习笔记4:多进程和多线程的使用方法和区别
- python #coding:utf-8和setdefaultencoding有什么区别?
- python学习笔记-静态方法和类方法区别
- Python学习笔记之疑问11:批量赋值
- 【Python】学习笔记——-Python2 和 Python3的区别
- Python学习笔记之疑问12:什么是tuple
- Python学习笔记:Convert UTF-8 with BOM to UTF-8 without BOM in Python
- #!/usr/bin/env python与#!/usr/bin/python的区别-*-coding:utf-8-*-和 coding:utf-8区别
- python网络编程学习笔记(2)--TCP和UDP区别(补充)