python中類中 引數的靈活使用

紫翼龍王夜發表於2016-06-01
#coding:utf-8 
class make: 
#projName = "zhang long is SB"  #建構函式  
    def __init__(self,gege):
        self.mvn="/root/online/maven/apache-maven-3.2.3/bin/mvn"  
        self.gitPath="/root/online/jiea-project/common-h5/common-h5"  
        self.ce=gege 
    def mvn1(self,name,shelve): 
        self.projName = name 
        self.shelve = shelve 
        print self.projName 
        print self.shelve 
print "start" 
projName='sb' 
B = make(projName) 
print "-------" 
B.mvn1(projName,projName) 
print "-----" 
print 'hello world' 
print "end"  
def zl(a,b,c): 
    print 
    print 
    print c
f="hhe" 
d="hehe2" 
e="hehe3" 
zl(f,d,e)


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30129545/viewspace-2112355/,如需轉載,請註明出處,否則將追究法律責任。

相關文章