Calling a function from module question.

Steven Bethard steven.bethard at gmail.com
Tue Feb 15 16:35:12 EST 2005


Sean wrote:
>>Sean wrote:
>>
>>>Then I would have a script that uses the
>>>print_this function defined in the module
>>>without using the module name in the call.
>>
>>from module_name import print_this
>>
>>or, even:
>>
>>from module_name import print_this as other_nice_name
> 
> So what if I have a whole bunch of functions - say 25 of them.
> Is there a way to do this without naming each function?

Yes [1], but it's basically deprecated and you shouldn't use it. 
Consider refactoring your code.

Steve

[1] http://docs.python.org/ref/import.html



More information about the Python-list mailing list