亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

python - How to pass parameters to a module, the parameter is the function name of the module?
扔個三星炸死你
扔個三星炸死你 2017-06-12 09:26:33
0
1
1067

I hope to execute multiple functions in the module by passing parameters.

For example: there are functions daifu, jiekuan, and tixian in the tb module
import tb
tb.daifu.save(os.path.join(args.savedir, xlname))

Directly write the module. The function name can be called. But if the value of the function name is passed, the type is wrong. It is not a function but a string.
I would like to ask how to use the function name of the parameter type as a function?

扔個三星炸死你
扔個三星炸死你

reply all(1)
世界只因有你
getattr(tb, 'daifu').save(os.path.join(args.savedir, xlname))

Is this so?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template