I know what your getting at, this will work if you want to have variables in 
the included file in scope in the caller of 'include', just insert it as normal 
python.

Though I prefer this version as it is simpler and less error prone.

with open('myfile.py') as f: exec(f.read())

Basically, it includes the file and keep the scope of all variables that came 
before this type of include statement.  Very useful for this like a shared 
authentication file across an entire website of multiple files/pages.

Happy Thanksgiving!
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/TC2T35Y53ZZN53EU56W6FRU777DPRANK/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to