All of the modules are described using For example: MODULE_VAR1 = "Hello" MODULE_VAR2 = "the lazy" MODULE_VAR3 = "" "MODULE_VAR4 =" Quick "MODULE_VAR5 =" brown "... MODULE_VAR10 =" "MODULE_VAR11 =" dog! "MODULE_VAR12 =" now "MODULE_VAR13 =" is "... MODULE_VAR98 =" was "MODULE_VAR99 =" all "MODULE_VAR100 =" people! "Def abs (): print" absolutely useful function:% s " % MODULE_VAR1 of course we need to override the Just import module MODULE_VAR * and I have used 100 variables as an example, because doing module import MODULE_VAR1, MODULE_VAR2, MODULE_VAR3, ..., MODULE_VAR100 to be clearly unreliable and if more will not work in variables (e.g. If you have a helper function can be done without it - and it's magic: Clearly the frame introspection spell is avoided, which is generally considered harmful. P> import is a bad idea, though, what Is there a way to import subset content from
module using a wildcard?
would like not to use because we want
abs function module imports. But assume that we all replace the
MODULE_VAR * variable If you want to be accessible.
is put. Is there any way to help him?
MODULE_VAR101 ) were added.
import ref define_import (patterns, modules, global): for the key, value in module. Item (): If re.findall for example:
Import import import constants match_portport ("MODULE_VAR. *", Constants, globals ())
No comments:
Post a Comment