Re: [Tutor] passing dictionaries through a file

2015-03-17 Thread David Heiser
On 3/16/2015 5:04 PM, Alan Gauld wrote: On 16/03/15 20:39, Doug Basberg wrote: I would like to pass the contents of a dictionary from one program to another through a file. So, what is the elegant way to pass a dictionary by file? The elegant way may be not to use a file. A Python diction

Re: [Tutor] passing dictionaries through a file

2015-03-16 Thread Ben Finney
"Doug Basberg" writes: > I would like to pass the contents of a dictionary from one program to > another through a file. The term for this in programming is “serialisation”, in the sense that a specific series of bits will represent the Python value, and you want to convert to and from that seri

Re: [Tutor] passing dictionaries through a file

2015-03-16 Thread Oscar Benjamin
On 16 March 2015 at 20:39, Doug Basberg wrote: > > I would like to pass the contents of a dictionary from one program to > another through a file. So, what is the elegant way to pass a dictionary by > file? My early learning about Python seems to indicate that only ascii is > easily passed in fi

Re: [Tutor] passing dictionaries through a file

2015-03-16 Thread Alan Gauld
On 16/03/15 20:39, Doug Basberg wrote: I would like to pass the contents of a dictionary from one program to another through a file. So, what is the elegant way to pass a dictionary by file? The elegant way may be not to use a file. A Python dictionary usually converts easily to JSON format wh

[Tutor] passing dictionaries through a file

2015-03-16 Thread Doug Basberg
I would like to pass the contents of a dictionary from one program to another through a file. So, what is the elegant way to pass a dictionary by file? My early learning about Python seems to indicate that only ascii is easily passed in files. I am using Python 2.7.4 now. Should I be learning o