Re: [Tutor] pickle.dump yielding awkward output

2013-02-04 Thread Steven D'Aprano
On 04/02/13 22:12, Spyros Charonis wrote: Thank you Alan, Steven, I don't care about the characters from the pickle operation per se, I just want the list to be stored in its native format. That's an in-memory binary format. There is no way to get access to that from pure Python code. You may

Re: [Tutor] pickle.dump yielding awkward output

2013-02-04 Thread Alan Gauld
On 04/02/13 11:12, Spyros Charonis wrote: What I am trying to do is basically the Unix shell equivalent of: "Unix command" > newfile.txt That works just fine with Python too. Just print to stdout in whatever format you want and redirect the output to a file $ python myscript.py > myfile.tx

Re: [Tutor] pickle.dump yielding awkward output

2013-02-04 Thread Spyros Charonis
Thank you Alan, Steven, I don't care about the characters from the pickle operation per se, I just want the list to be stored in its native format. What I am trying to do is basically the Unix shell equivalent of: "Unix command" > newfile.txt I am trying to store the list that I get from my code

Re: [Tutor] pickle.dump yielding awkward output

2013-02-03 Thread Alan Gauld
On 03/02/13 19:26, Spyros Charonis wrote: I am experiencing a strange result with the pickle module when using it to write certain results to a separate file. The only strangec results using pickle would be if the uinpickle failed to bring back that which was pickled. Pickle is a storage form

Re: [Tutor] pickle.dump yielding awkward output

2013-02-03 Thread Steven D'Aprano
On 04/02/13 06:26, Spyros Charonis wrote: The output stored from the call to the pickle.dump method, however, looks like this: [...] Does anyone know why the strings lp0, S', aS' are showing up? Why do you care? Pickle is not a human-readable format. It may use plain text (optionally, ther

Re: [Tutor] pickle.dump yielding awkward output

2013-02-03 Thread Dave Angel
(top-posting and offline response fixed) On Sun, Feb 3, 2013 at 11:07 PM, Dave Angel wrote: On 02/03/2013 02:26 PM, Spyros Charonis wrote: Hello Pythoners, I am experiencing a strange result with the pickle module when using it to write certain results to a separate file. In short, I have a

Re: [Tutor] pickle.dump yielding awkward output

2013-02-03 Thread Dave Angel
On 02/03/2013 02:26 PM, Spyros Charonis wrote: Hello Pythoners, I am experiencing a strange result with the pickle module when using it to write certain results to a separate file. In short, I have a program that reads a file, finds lines which satisfy some criteria, and extracts those lines, s

[Tutor] pickle.dump yielding awkward output

2013-02-03 Thread Spyros Charonis
Hello Pythoners, I am experiencing a strange result with the pickle module when using it to write certain results to a separate file. In short, I have a program that reads a file, finds lines which satisfy some criteria, and extracts those lines, storing them in a list. I am trying to write this