声明 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
这个更萌!!
![]() | 1 master13 OP #(ω) coding:utf8 (ω) |
![]() | 2 lao454490095 2016-01-05 17:29:59 +08:00 楼主好样的,以后试试 #O(∩_∩)O coding:utf8 O(∩_∩)O ,哈哈哈哈 |
![]() | 3 chmlai 2016-01-05 17:32:12 +08:00 编辑器自动补全的 |
![]() | 4 lululau 2016-01-05 17:34:24 +08:00 |
5 vanxining 2016-01-05 17:38:17 +08:00 via Android 我也不知道啊,大家都这用的。原来还有其他用法…… |
![]() | 6 florije 2016-01-05 17:38:57 +08:00 楼上是来源正解,不过 LZ 也说的对,毕竟一般的使用哪种写法就足够了。 |
![]() | 7 Tink PRO 我同三楼,编辑器自动的 |
![]() | 9 9hills 2016-01-05 17:41:01 +08:00 你喜欢萌,为什么不#-_- coding:utf8 -_- 以后就用这个了 |
![]() | 10 Hello1995 2016-01-05 17:41:23 +08:00 via Android 这是 emacs 字符集相关的历史遗留问题… |
![]() | 11 GHfan 2016-01-05 17:58:59 +08:00 表示,在项目里一直推荐他们用 #coding:utf8 我要用 #-_- coding:utf8 -_- 报复他们!! |
![]() | 12 tobyxdd 2016-01-05 19:01:01 +08:00 via Android # coding: utf-8 |
13 mengzhuo 2016-01-05 19:12:02 +08:00 vim 自动补齐的…… |
14 bertonzh 2016-01-05 19:42:52 +08:00 #+_+ coding:utf8 +_+ |
![]() | 15 clino 2016-01-05 19:48:49 +08:00 #coding: utf-8 |
![]() | 16 zsj950618 2016-01-06 02:29:50 +08:00 via Android pep0263 里说了啊,为了方便各种各样的编辑器识别啊。。。。 line in the file, such as: # coding=<encoding name> or (using formats recognized by popular editors) #!/usr/bin/python # -*- coding: <encoding name> -*- |
![]() | 17 songkaiape 2016-01-06 10:41:15 +08:00 @clino 看到这里忍不住笑了 |
18 chenyuxiaodhr 2016-01-06 12:13:15 +08:00 #/ w\ coding:utf8 / w\ |
![]() | 19 rxkh 2016-01-08 10:34:02 +08:00 |