python初体验


                    这两天正在学习python。偶尔看到一篇名为《Python 研究(Dive Into Python)》的东东,看着看着我觉得我发现了一个新的好玩的语言,与我以前所学的C和Basic思维模式不同的语言。
    我的操作系统装的是Magic Linux 2.0,桌面用Fvwm。在终端中输入“python”就会显示:
Python 2.4.1 (#1, Jul 27 2005, 10:49:07)
[GCC 3.4.3 20041114 (Magic Linux 3.4.3-3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
    我下载并安装了
http://www.magiclinux.org/people/haulm/RPMS/wxPython-common-gtk2-unicode-2.6.3.2-1_py2.4.i686.rpm
http://www.magiclinux.org/people/haulm/RPMS/wxPython2.6-devel-gtk2-unicode-2.6.3.2-1_py2.4.i686.rpm
http://www.magiclinux.org/people/haulm/RPMS/wxPython2.6-gtk2-unicode-2.6.3.2-1_py2.4.i686.rpm
    然后测试了一个小程序:

# -*- coding: utf-8 -*-
aa =u'\u6211\u4eec'
bb =u'中文'
import wx   # Assuming you have a Unicode build as your default wxPython.
App = wx.App()
dlg = wx.MessageDialog(None, u'My Unicode character is %s and %s' % (aa,bb))
dlg.ShowModal()
dlg.Destroy()
   
    这是运行的结果: