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

Upgrade php version of xampp not success -

amazon web services - S3 and apache mod_proxy with basic authentication -

powershell - This solution contains one or more assemblies targeted for the global assembly cache -