Need to import stuff

Abhijeet abhijeet.thatte at gmail.com
Thu Aug 19 00:59:07 EDT 2010


Hi,

Used imp. It worked.

Thanks


Daniel Kluev wrote:
>
> On Wed, Aug 18, 2010 at 9:40 AM, abhijeet thatte 
> <abhijeet.thatte at gmail.com <mailto:abhijeet.thatte at gmail.com>> wrote:
>
>     Hi,
>
>     Thanks for the reply. But I guess it does not support nested file
>     paths. 
>     If user gives 'abcd' then I need to import "//*Do/Stuff/abcd*/".
>     Out of which only /"abcd" is taken run time. Do and Stuff are fixed. /
>     /I got an error "/ImportError: Import by filename is not
>     supported.". Any solution??
>
>
> For complex importing, you can use imp module,
> http://docs.python.org/library/imp.html
>
> Like this:
> module_desc = imp.find_module(name, [base_path])
> module = imp.load_module(full_name, *module_desc)
>  
> -- 
> With best regards,
> Daniel Kluev
>




More information about the Python-list mailing list