from ChemPlugin import * print("Link ChemPlugin instances into a chain\n") # Create the ChemPlugin instances nchain = 8 cp_inlet = ChemPlugin() cp = [ChemPlugin() for i in range(nchain)] # Link the instances into a chain # >>> Link the inlet to first instance in chain <<< # >>> Loop from second instance to end of chaim <<< # >>> Link first instance to second, second to third, ... <<< # >>> Create a free outlet at end of chain # Report the number of links to each instance print("Inlet is linked to %s" % cp_inlet.nLinks() + " instance") for i in range(nchain): print("Instance %s is linked to %s instances" % (i, cp[i].nLinks())) input("Done!")