Instead of directly editing py files within other py files, you should use the Pickle module. Pickle module allows you to save objects (dictionaries, lists, etc.) in a file which is binary formatted. Then you can fetch those dictionaries or whatever you saved, from the file itself without anything else.
You can also use the JSON module if you want pure simplicity and data interchange.
Here's how you can do something similar with the JSON module:
>> import json
>> a = {'foo': 'bar', 'hello': 'jello'}
>> json.dumps(a)
>> '{"foo": "bar", "hello": "jello"}'
NOTE: The json module will turn any single quote into double quotes as JSON itself does not accept single quote. And also notice the 's' after 'dump'. It makes sure that the function returns pure string rather than any binary format.
Hope, that helps you :D