how to include a file -- not import??

Darrell news at dorb.com
Wed Jan 5 23:52:46 EST 2000


from filename import *

Doesn't create another namespace. Avoid this in most cases.

Use import filename and filename.someVar the "from" was intended to help
when your running Python interactively.

--
--Darrell
"John Nielsen" <nielsenjf at my-deja.com> wrote in message
news:8515bs$2vn$1 at nnrp1.deja.com...
> Hopefully, there's a simple answer to a problem I am having.
>
> I am using import to include a file, however, it looks like the module
> then has another namespace, which means it can't access some variables.
>
> Is there a way to simply include the raw text and insert it into your
> own code, as if it was not in a another file?
>
> Thanks for any help,
>
> john
>
>
>
> --
> nielsenjf at my-Deja.com
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
> --
> http://www.python.org/mailman/listinfo/python-list





More information about the Python-list mailing list