__init__方法在类的一个对象被建立时,马上运行.这个方法可以用来对你的对象做一些你希望的初始化. 代码例子 test.py#!/usr/bin/python# Filename: class_init.pyclass Person: def __init__(self, name): self.name = name def sayHi(self): print Hello, my name is, self.name p = Person(Swar
Python安装与环境变量的配置 python下载: Python安装包下载地址:http://www.python.org/ 根据实际的操作系统,安装合适的安装版本. Python安装: 本文以python 2.7.8(64位)为例说明,具体安装步骤如下: 1.双击下载包,进入Python安装向导. 2.选择安装目录.如:D:\Python27\ 3.选择 Add python.exe to Path>>Entire feature will be installed on loca
python下载: Python安装包下载地址:http://www.python.org/ 根据实际的操作系统,安装合适的安装版本. Python安装: 本文以python 2.7.8(64位)为例说明,具体安装步骤如下: 1.双击下载包,进入Python安装向导. 2.选择安装目录.如:D:\Python27\ 3.选择 Add python.exe to Path>>Entire feature will be installed on local hard drive 4.点击&quo