Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PriorityQueue loadfname does not appear to work #9

Open
ghost opened this issue Aug 6, 2013 · 0 comments
Open

PriorityQueue loadfname does not appear to work #9

ghost opened this issue Aug 6, 2013 · 0 comments

Comments

@ghost
Copy link

ghost commented Aug 6, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants