[Tutor] pickle.dump yielding awkward output
alan.gauld at btinternet.com
Mon Feb 4 13:50:41 CET 2013
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.txt
That will work from a command line in Windows, Linux and MacOS...
> I am trying to store the list that I get from my code in a separate
> file, in human-readable format.
Then print it in the format you want using string formatting to control
spacing, justification etc.
Author of the Learn to Program web site
More information about the Tutor