newbie Q: shortcuts for long module names?
Erik Max Francis
max at alcyone.com
Mon Nov 11 22:34:09 EST 2002
Robert Oschler wrote:
> Let's say I import a module with a long name:
>
> import com.long.module.name
>
> Now every time I access a function in com.long.module.name I have to
> prepend
> "com.long.module.name" to the member function. Is there generally
> accepted
> and safe way to "alias" the module name or bring it into the local
> namespace
> so I can either omit or alias the module name with something much
> shorter?
Try
import this.is.a.long.module.name as name
or
import this.is.a.long.module.name as somethingElse
--
Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
__ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/ \ There are defeats more triumphant than victories.
\__/ Montaigne
Polly Wanna Cracka? / http://www.pollywannacracka.com/
The Internet resource for interracial relationships.
More information about the Python-list
mailing list