import - How to execute only some functions from other python modules? -


[problem] want execute functions other python modules

[input] module 1, module 2

module 1 includes:

  1. function called ( def a)
  2. function called ( def b)

[module 2] includes:

from module1 import b 

current: function , function b executed. desired: function b should executed.

if have ideas please share.

if import module has code outside class/function, code run. if module calls function outside definition, runs. consider not calling function in module file.


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -