How to read the data inside any type of input from ghenv command

Alex, isn’t this the exact same problem you had in your previous post? (Question on ExpireSolution in GhPython) I explained how to get around the ‘object expired in solution’ errors by using SolutionSchedule, but your file above doesn’t follow any of it, and makes no sense at all with relation to your description - you’re constructing a nested list of 5000 random items without reference to the inputs or outputs?
Also, ‘set’ is a reserved word in Python, you really shouldn’t be overriding it.

I was a little hesitant in leading you down this direction previously, because it seemed like you’re trying to dive into the sparsely-documented inner workings of Grasshopper without a solid grasp of its basic interface or of the Python language… Maybe you could take a look at the Hoopsnake or Anemone plugins, they allow you to do sequential iteration on the canvas with the full introspection of states and variables that Grasshopper provides .