qr icon indicating copy to clipboard operation
qr copied to clipboard

PriorityQueue loadfname does not appear to work

Open ghost opened this issue 11 years ago • 0 comments

I am not able to reload the content of the PriorityQueue from file using the following:

from qr import PriorityQueue filename = "test.data"

pr = PriorityQueue('test')

pr.push('one', 1) pr.push('two', 2) pr.push('end', 3)

print pr.elements()

pr.dumpfname(filename, True)

print pr.elements()

print file(filename).read()

pr.loadfname(filename)

print len(pr.elements())

When I run the script I see the following:

python test_pq.py ['one', 'two', 'end'] [] S'o' .S't' .S'e' . 0

It appear that it has not possible to reload the content from the file. Not sure if the issue is in the serializing the data to read to file or in th read back from file.

ghost avatar Aug 06 '13 13:08 ghost