2010年9月6日
摘要: 学习材料:learning python 4th例子代码:[代码]Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1 ### file: script1.py2 3 # A first Python script4 import sys # Load ... 阅读全文
posted @ 2010-09-06 15:54 菜刀大侠 阅读(622) 评论(0) 推荐(0) 编辑
  2010年9月4日
摘要: 中文版p83页:girls = ['alice', 'bernice', 'clarice']boys = ['chris', 'arnold', 'bob']letterGirls = {}for girl in girls: letterGirls.setdefault(girl[0], []).append(girl)print ([b+'+'+g for b in boys for g i... 阅读全文
posted @ 2010-09-04 21:45 菜刀大侠 阅读(394) 评论(0) 推荐(0) 编辑
  2010年8月31日
摘要: <<learning python>>dictionary:Accessed by key, not offsetDictionaries are sometimes called associative arrays or hashes. They associate a setof values with keys, so you can fetch an item o... 阅读全文
posted @ 2010-08-31 03:12 菜刀大侠 阅读(936) 评论(0) 推荐(0) 编辑
  2010年8月24日
摘要: Attribute Description__class__ A reference to the class from which the object was instantiated.__dict__ A dictionary that corresponds to the object’s namespace. Each keyvalue pair represents an ... 阅读全文
posted @ 2010-08-24 14:31 菜刀大侠 阅读(225) 评论(0) 推荐(0) 编辑
摘要: Attribute Description__bases__ A tuple that contains base classes from which the class directly inherits.If the class does not inherit from other classes, the tuple is empty.[Note: We discuss base cla... 阅读全文
posted @ 2010-08-24 14:20 菜刀大侠 阅读(338) 评论(0) 推荐(0) 编辑
摘要: <<DEITEL - Python How to Program 2002>>7.2 Implementing a Time Abstract Data Type with a ClassClasses enable programmers to model objects that have data (represented as attributes) and beh... 阅读全文
posted @ 2010-08-24 02:02 菜刀大侠 阅读(278) 评论(0) 推荐(0) 编辑
  2010年8月23日
摘要: 简介wxPython wxPython是Python编程语言的一个GUI工具箱。他使得Python程序员能够轻松的创建具有健壮、功能强大的图形用户界面的程序。它是Python语言对流行的wxWidgets跨平台GUI工具库的绑定。而wxWidgets是用C++语言写成的。 和Python语言与wxWidgets GUI工具库一样,wxPython是开源软件。这意味着任何人都可以免费地使用它并且可以... 阅读全文
posted @ 2010-08-23 08:48 菜刀大侠 阅读(1189) 评论(0) 推荐(0) 编辑
摘要: py2exe打包,遇到找不到msvcp9.dll 周海汉 /文http://blog.csdn.net/ablo_zhou/archive/2010/02/07/5295750.aspx2010.2.7今天用py2exe打包python程序,结果遇到如下错误:view plaincopy to clipboardprint?*** searching for required modules **... 阅读全文
posted @ 2010-08-23 07:46 菜刀大侠 阅读(984) 评论(0) 推荐(0) 编辑
  2010年8月22日
摘要: 《illustrate c# 2008》:User-Defined Type Conversions用户定义类型转换User-defined conversions are discussed in greater detail in Chapter 18, but I will mention them here as well because they are operators.用户定义类型... 阅读全文
posted @ 2010-08-22 18:50 菜刀大侠 阅读(389) 评论(0) 推荐(0) 编辑
摘要: Other important facts about class derivation are the following:关于继承类的其他要点如下:• A class declaration can have only a single class listed in its class-base specification. This is called single inheri... 阅读全文
posted @ 2010-08-22 02:03 菜刀大侠 阅读(378) 评论(0) 推荐(0) 编辑
摘要: 《illustrate c# 2008》:All Classes Are Derived from Class object所有的类来自于类objectAll classes, except special class object, are derived classes, even if they don’t have a class-base specification. Cla... 阅读全文
posted @ 2010-08-22 01:51 菜刀大侠 阅读(371) 评论(0) 推荐(0) 编辑
摘要: 《illustrate c#2008》:Figure 7-1 shows an instance of each of the classes. Class SomeClass, on the left, has one field and one method. Class OtherClass, on the right, is derived from SomeClass and conta... 阅读全文
posted @ 2010-08-22 01:34 菜刀大侠 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 《illustrate c#2008》:Inheritance allows you to define a new class that incorporates and extends an already declared class.继承允许你定义一个新的类。这个新的类---包含并且扩展原来已经存在的类。• You can use an existing class, calle... 阅读全文
posted @ 2010-08-22 00:48 菜刀大侠 阅读(347) 评论(0) 推荐(0) 编辑
  2010年8月20日
摘要: 今天来到博客园,甚是高兴。昨日苦思冥想出一个结论:乃目的与手段需要分离。或许别人看来是显而易见的道理,对于自己想通才是真道理。我想探讨的是2种人。一种是上目的性很强的人和一种目的性弱的人。注意,我找不到好的词汇形容这2种意思,只好用看起来带贬义和褒义色彩的词汇了。我本意是这所谓的目的性强的人和目的性弱的人只是引出我的说法的分类而已,没有褒贬。我本人就是所谓的目的性强的人,干什么都很有“... 阅读全文
posted @ 2010-08-20 08:50 菜刀大侠 阅读(269) 评论(0) 推荐(0) 编辑