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

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -