On Mon, 26 Apr 2010 11:56:06 am Rayon wrote:
> I have a module with the name _table
> in the same directory I have another by the name of _module
>
> I would like to import _table into _module
>
> can someone tall me how.

At the beginning of the _module module (what a name! yuck! don't you 
have a more descriptive name you can use?), put this line:

import _table


Then whenever you need something from _table, you write something like 
this:

print _table.my_function("something")


> from tables.report_db_engine import *

Two comments:

What is "tables"? Is that the same as _table?

Generally you shouldn't use the "from module import *" form. You should 
consider it advanced usage, or at least discouraged.



-- 
Steven D'Aprano
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to