accesibility of the namespace

Petr Jakes petr at
Thu Mar 9 10:42:55 CET 2006

In my code I have relatively wide dictionary definition (about 100

I would like to put it in to the different file (module) because of the
main code readability (say the name of the file will be

In the dictionary I have strings formatted using % operator like:
lcd={2:"Your credit= %3d" % (credit)}

While I am trying to import my_dictionary in to the main code, I am

exception unhandled NameError
name "credit" is not defined

How can I organize my code so the "credit" variable will be "visible"
in the "my_dictionary" namespace?


Petr Jakes

More information about the Python-list mailing list