def func(*args):标签:__,oper,python,self,time,可变,ready,offline,lambda From: https://blog.51cto.com/u_11146845/6080891
print len(args)
print args[1]
print args
if __name__ == '__main__':
mylist = [1,7200,3]
func(*mylist)
func(1,2,3,4) #传参
class Test():
#select a.id, a.creator, a.outer_url, t.ready_offline_oper, t.ready_offline_start_time, t.offline_oper, t.ready_offline_end_time
def __init__(self, apivid = '', outer_url = '', ready_offline_oper = '', ready_offline_start_time = '', offline_oper = '', ready_offline_end_time = '', creator = ''):
self.apivid = apivid
self.outer_url = outer_url
self.ready_offline_oper = ready_offline_oper
self.ready_offline_start_time = ready_offline_start_time
self.offline_oper = offline_oper
self.ready_offline_end_time = ready_offline_end_time self.creator = creator
if __name__ == '__main__':
listPara = [12, '/test/help', 'fish']
apiinfo = Test(*listPara) # *表示传入的是一个元组, **表示传入的是dict
------------------------------------
def func(**kwargs):
print kwargs
if __name__ == '__main__':
# listPara = [12, '/test/help', 'fish']
# apiinfo = ApiOfflineInfo(*listPara)
func(**{'a':1, 'b':2, 'c':3})