2009年4月
« 3月   5月 »
 12345
6789101112
13141516171819
20212223242526
27282930  

カテゴリー

pythonのコードの中に日本語を使用する

下のようなエラーメッセージへの対処
>|zsh|
SyntaxError: Non-ASCII character ‘\xe3′ in file test.py on line 8, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
||<

2行目か1行目に、# coding=xxxという文字を入れる
>|python|
1 #!/usr/local/bin/python
2 # coding=utf-8
3 import ImageFont, ImageDraw, Image
4
||<

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>