我对Python的结构有点困惑。本质上,我们什么时候需要self作为参数,我应该如何构造Python (不一定只是一个.py文件)?#!usr/bin/python3.4 # shabang for your python interp. dir.我不明白的是__name__是从哪里来的。这是每次创建新模块时创建的吗?另外,为什么不需要一个if语句的
帮助我理解object在这一行中的含义:s = ' ' + object.__str__(obj)。我没有在代码中看到过object,它是一个特殊的关键字吗?在这种情况下,这意味着什么?指向完整代码的链接:def __str__(self):
"""Return a string representaion of this Kangaroo.self.name +
我使用PHP已经有一段时间了,并且刚刚开始使用Python。Python中有一个特性是我在学习时遇到的。IN Python #some class Properties
a = A() # assiging an expression to the classProperty is possible with python.PHP中的cl