In jython, I have an object class defined as follows:
class Item: def __init__(self, pid, aisle, bay, hits, qtyPerOrder): self.pid = pid self.aisle = int(aisle) self.bay = bay self.hits = int(hits) self.qtyPerOrder = int(qtyPerOrder)
I created a list of classes called a βlistβ of elements in a class with 4000 lines that look like this:
'PO78141', 13, ' B ', 40
I am trying to randomly select a number in the range of 3 to 20, called x. Then the code will select x the number of lines in the list.
For example: if x = 5, I want it to return:
'PO78141', 13, ' B ', 40 'MA14338', 13, ' B ', 40 'GO05143', 13, ' C ', 40 'SE162004', 13, ' F ', 40 'WA15001', 13, ' F ', 40
EDIT Well, this works. However, it returns this < main .Item object in 0x029990D0>. How can I return it in the format above?