newbie question about import

Craig craigb at ati-uk.com
Thu Jun 3 16:05:57 CEST 2004


ok, so i understand that there are important differences between import and
#include, but the thing i don't get is why you can't do something like
import "d:\dev\build\config.py"?

is it good style to do this to get the above behaviour:

import sys
sys.path.append(/my/include/path)
import my-include-file


"Craig" <craigb at ati-uk.com> wrote in message
news:10bu94apffq0tcf at corp.supernews.com...
> anwering my own query...i see that this a common question amongst python
> newbies. i shall look around the web a bit and see if i can work it out.
>
> "Craig" <craigb at ati-uk.com> wrote in message
> news:10bu894hg9q6379 at corp.supernews.com...
> > hi all,
> >
> > is there a python equivalent to the C preprocessor statement #include
> > relative-or-absolute-path?
> > i want to import code in a specific file into my script.
> >
> > thanks,
> > craig
> >
> >
>
>





More information about the Python-list mailing list