版本2和85间的区别 (跳过第83版)
于2005-12-21 19:34:04修订的的版本2
大小: 1215
编辑: czk
备注:
于2007-05-14 07:35:49修订的的版本85
大小: 726
编辑: czk
备注:
删除的内容标记成这样。 加入的内容标记成这样。
行号 1: 行号 1:
Python的编码处理技术  * ["Python介绍"] from Wikipedia
 * ["Python语法"] from Wikipedia
 * ["Why Python"] by Eric Raymond
 * ["Python Advocacy HOWTO"] by A.M. Kuchling
 * ["Python使用技巧"] by myself
 * ["Python参考资料"] by myself
 * 课程:["Python游戏开发基础"]
 * ["Python与正则表达式"]
 * Using IDLE: attachment:idleUse05b.zip
 * Learning to Program: attachment: http://www.freenetpages.co.uk/hp/alan.gauld/
 * Learn To Program CD: attachment:LearnToProgramCD.zip
 * Tkinter Life Preserver: http://www.python.org/doc/life-preserver/
 * Python介绍视频Introducing Python: http://czk.8866.org/~czk/IntroducingPython.mpg
行号 3: 行号 15:
对于中文用户,特别需要关注Python的编码技术. 列举一些常用的技巧。
行号 5: 行号 16:
    * 代码中的编码设置,应该在代码最初两行内包含:
{{{
      # -*- coding: gb18030 -*-
}}}
    * 获得/设置系统的缺省编码
{{{
      sys.getdefaultencoding()
------
行号 13: 行号 18:
      sys.setdefaultencoding('utf-8')
}}}
    * 获得文件系统的文件名的编码
{{{
      sys.getfilesystemencoding()
}}}
    * 获得当前终端的输入、输出编码
{{{
      sys.stdout.encoding

      sys.stdin.encoding
}}}
    * 编码转换(先转换为unicode,再转换为具体的编码),有两种方法:
{{{
      unicode('abc', 'mbcs').encode('utf-8')

      'abc'.decode('mbcs').encode('utf-8')
}}}
学习资料
 * [http://diveintopython.org/ Dive Into Python(较老的版本有中文翻译)]
 * [http://www.python.org/ Python官方站点]
 * [http://python.cn/ Python中文社区]
 * [http://groups.google.com/group/comp.lang.python Python讨论组comp.lang.python]
 * [http://www.ibiblio.org/obp/thinkCSpy/ How to Think Like a Computer Scientist (Learning with Python)]
 * [http://pine.fm/LearnToProgram/ Learn to Program]
 
 * Q:去哪里下载python解释器?
 * A:http://www.python.org/


Python (2020-06-05 17:12:03由czk编辑)

ch3n2k.com | Copyright (c) 2004-2020 czk.