GHPY After compiling, parameters can be dynamically added or subtracted

I need to make the I/O changes in the compiled Python code. The target plug-in is the Merge plug-in for Tree. But I didn’t find the right way. Some uses of the framework are unfamiliar. Ask if there is a great God to help.

def RegisterInputParams(self, pManager):
    p = Grasshopper.Kernel.Parameters.Param_GenericObject()
    p.Simplify = True
    p.PersistentData.ClearData()
    self.SetUpParam(p, "Data1", "D1", "第一组数据")
    p.Access = Grasshopper.Kernel.GH_ParamAccess.tree
    self.Params.Input.Add(p)

    for i in range(2, 10):
        p = Grasshopper.Kernel.Parameters.Param_GenericObject()
        p.Simplify = True
        p.PersistentData.ClearData()
        self.SetUpParam(p, "Data%d"%i, "D%d"%i, "第%d组数据"%i)
        p.Access = Grasshopper.Kernel.GH_ParamAccess.tree
        self.Params.Input.Add(p)


Here’s what I’m looking for