I am writing a program in python 3 to enqueue and dequeue objects called packets. These packets have priorities associated with them and I would like the priority queue to dequeue the packets in priority order. Below is the code:
if(pkt.pktId != -1):
print("pktID: ", pkt.pktId, "srcID :", pkt.srcID)
arbiter1.put(pkt.pri, pkt)
while ((arbiter1.empty()==False) and (queueList[0].full()==False)):
x= arbiter1.get()
queueList[0].put(arbiter1.get())
Pkt is of type Packet Class() and contains multiple fields. One of the fields is pri.
When I dequeue "x" and print x, it gives me an int rather than the object pkt.
arbiter1?