如下写法
def run1(data,data1,**kwargs):
print(data,data1,kwargs)
if __name__ == '__main__':
run1(123,321534,data34 = 'asdf')
- data1和data2为已经设定过了的参数,直接传进去,data34为没有设定的参数,也可通过kwargs传进去
打印的结果是
123 321534 {'data34': 'asdf'}
def run1(data,data1,**kwargs):
print(data,data1,kwargs)
if __name__ == '__main__':
run1(123,321534,data34 = 'asdf')
123 321534 {'data34': 'asdf'}