On 6/23/2011 10:09 AM, Gnarlodious wrote:
On Jun 23, 7:59 am, Noah Hall wrote:
>from a import x

I'm doing that:
import Module.Data as Data

However I end up doing it in every submodule, so it seems a little
redundant. I wish I could load the variable in the parent program and
have it be available in all submodules. Am I missing something?

Yes. Make a project ~template.py file that includes the common import.
Mine is something like

#!python3
 '''project_dir/.py -- 2011
Copyright Terry Jan Reedy

'''
from test import ftest,itest


def test_main():


if __name__ == '__main__':
    test_main()

--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to