[Tutor] Working with files, Truckers log

glidedon glidedon <glidedon@c-zone.net>
Thu, 04 Apr 2002 22:13:14 +0000


>At 05:58 PM 4/4/2002 +0000, glidedon wrote:
>
>>I think I know how to read and write to a file ,but how do I
>>insert this data into the list in my program ?
>
>Note that one solution to saving data is to write out
>text which also happens to be executable Python code.
>Save the file as a .py, and when you want your data
>back, just import it.
>
>For example, if my saved data file looks like this:
>
>a = [1,2,3]
>b = {'a':10,'b':30}
>
>then in another program I can go:
>
>from mydata import a,b
>
>and I'll have those values available to me.
>
>Just a thought.
>
>Kirby
>
>
>
>

Thanks Kirby

That's a thought that would have never crossed my synapses , without me 
timing out :-)

Don