This topic created in 3954 days ago, the information mentioned may be changed or developed.
声明 python 源代码编码有很多种方法,明明#coding:utf8多简洁,你为什么非要用#-*- coding: utf-8 -*-,是因为它看起来更萌吗??!!!
你看这里,人家都说了,只要 the first or second line must match the regular expression coding[:=]\s*([-\w.]+),匹配上这玩意就行。
你喜欢萌,为什么不#-_- coding:utf8 -_-
#O(∩_∩)O coding:utf8 O(∩_∩)O 这个更萌!!
19 replies • 2016-01-08 10:34:02 +08:00
 |
|
#(๑¯ω¯๑) coding:utf8 (๑¯ω¯๑)
|
 |
|
楼主好样的,以后试试 #O(∩_∩)O coding:utf8 O(∩_∩)O ,哈哈哈哈
|
 |
|
编辑器自动补全的
|
 |
|
我也不知道啊,大家都这用的。原来还有其他用法……
|
 |
|
楼上是来源正解,不过 LZ 也说的对,毕竟一般的使用哪种写法就足够了。
|
 |
|
我同三楼,编辑器自动的
|
 |
|
@ florije ……看一眼的功夫多了个 5 楼,只能说 4 楼正解了。
|
 |
|
你喜欢萌,为什么不#-_- coding:utf8 -_- 以后就用这个了
|
 |
|
这是 emacs 字符集相关的历史遗留问题…
|
 |
|
表示,在项目里一直推荐他们用 #coding:utf8 我要用 #-_- coding:utf8 -_- 报复他们!!
|
 |
|
#😃 coding: utf-8 😃
|
 |
|
vim 自动补齐的……
|
 |
|
#+_+ coding:utf8 +_+
|
 |
|
#ლↀѡↀლcoding: utf-8ლↀѡↀლ
|
 |
|
zhsjJan 6, 2016 via Android
16
pep0263 里说了啊,为了方便各种各样的编辑器识别啊。。。。
line in the file, such as:
# coding=<encoding name>
or (using formats recognized by popular editors)
#!/usr/bin/python # -*- coding: <encoding name> -*-
|
 |
|
#/ w\ coding:utf8 / w\
|