EDIT: Are you sure the information gets written to the file People.dict? It looks to me like you just assign the dictionary to the variable People, but don't write it to the file.
I've tried your scripts. I don't get any errors on the second one, but nothing happens. I just don't know why, the code looks fine.
Anyway, I have an alternative:
Script 1:
Code:
import e32, appuifw, codecs
def quit():app_lock.signal()
appuifw.app.exit_key_handler=quit
# Open the dictionary in write mode
d = codecs.open(u"c:\\python\\People.dict", "w", "utf_8")
# Add the default entries into the dictionary
People = {'John' : {"Age": "20", "Address" : "blah"},
'Jim' : {"Age": "31", "Address" : "blah2"},
'Paul' : {"Age": "42", "Address" : "blah3"},
'Peter' : {"Age": "23", "Address" : "blah4"}}
People="People="+str(People)
d.write(People)
# Close the db
d.close()
app_lock=e32.Ao_lock()
app_lock.wait()
Script 2:
Code:
import e32, appuifw, codecs
def quit():app_lock.signal()
appuifw.app.exit_key_handler=quit
# Open it again , in read mode
dd = codecs.open(u"c:\\python\\People.dict", "r", "utf8")
t=dd.read()
exec(t)
for k in People.keys():
print k
print People[k]
dd.close()
app_lock=e32.Ao_lock()
app_lock.wait()
Basically all I did was put the dictionary assignment in a text file as a string and then execute it in the second script.
Sorry this is not the answer you were looking for, but I can't figure out why your code doesn't work.