虎牙滩

2008/04/08

重载Python类对象的打印函数

作者 nlog2n 时间 16:36 标签: python
class G:
def __init__(self):
g.nodes = "all nodes of G"
def __repr__(self):
return self.nodes
...
g = G()
print G

没有评论:

发表评论

较新的博文 较早的博文 主页
订阅: 博文评论 (Atom)

搜索此博客

标签

  • Android (4)
  • Linux (27)
  • Software Security (7)
  • iOS (1)
  • mySQL (4)
  • python (31)
  • virtualization (4)
  • windows (9)

所有文章

  • ►  2015 (12)
    • ►  十月 (3)
    • ►  七月 (1)
    • ►  六月 (2)
    • ►  一月 (6)
  • ►  2014 (4)
    • ►  十二月 (1)
    • ►  六月 (1)
    • ►  四月 (2)
  • ►  2010 (2)
    • ►  四月 (1)
    • ►  三月 (1)
  • ►  2009 (27)
    • ►  十二月 (1)
    • ►  十一月 (3)
    • ►  七月 (2)
    • ►  六月 (6)
    • ►  五月 (7)
    • ►  三月 (6)
    • ►  二月 (2)
  • ▼  2008 (60)
    • ►  十月 (3)
    • ►  八月 (11)
    • ►  七月 (4)
    • ▼  四月 (9)
      • Python: classmethod & staticmethod 区别
      • Python 下的图形界面开发
      • Python线程编程的两种方式
      • Django开发及mod_python安装
      • 重载Python类对象的打印函数
      • Python中的全局变量
      • Python中的时间操作
      • 在source insight中添加 python language
      • Python的时间操作 2
    • ►  三月 (14)
    • ►  二月 (3)
    • ►  一月 (16)
  • ►  2007 (7)
    • ►  一月 (7)
  • ►  2006 (1)
    • ►  八月 (1)

浏览次数

“简单”主题背景. 由 Blogger 提供支持.