USO400
  • Home
  • About
  • KH400
  • SuperSherpa
  • ZX-10
  • Todo
  • ALTO WORKS
  • KMX125
Sign in Subscribe

encode

A collection of 1 post
python

Pythonのエンコードを宣言する

Pythonでファイルのエンコードを宣言するとき # -*- coding: utf-8 -*- こういった内容を記載する人が多いと思いますが、自分にはこの記法には疑問がありました。 なぜEmacsを使わない人たちがEmacsのエンコードを宣言をするのだろうか。 会社ではEmacsを使うのは自分だけなので、もしかしたらこの記法がPythonのエンコード宣言だと思っているのかもしれません。 Vimではこう書く(らしい)です(Vimはほぼ使わないので知りません # vim:fileencoding=<encoding-name> Pythonのリファレンス 英文 If a comment in the first or second line of the Python script matches the regular expression coding[=:]\s*([-\w.]+), this comment is processed as an
2015年9月25日 1 min read
Page 1 of 1
USO400 © 2025
Powered by Ghost