caiji互啄のPydev的编码

2017-12-20  本文已影响0人  caiji酱

为了在Pydev中使用中文,可没少费心。终于结合多方面的资料加上自己的摸索,成功了!

废话不说了。我的环境是Eclipse 3.4.2 + Pydev1.5.0.1251989166 +python2.6.4

打开Eclipse,

1. Windows->Preferences->General->Editors->Text Editors->Spelling->Encoding,设置为UTF-8

2. Windows->Preferences->General->Workspace->Text file encoding,设置为UTF-8

3. Windows->Preferences->Pydev->Editors->Templates,将所有Context为New Module的Pattern都加上一句

# -*- coding: utf-8 -*-(注意,不是UTF-8,只能小写)

OK,现在新建一个Pydev Module试试 print u'你好,世界'。

Have fun!

上一篇 下一篇

猜你喜欢

热点阅读