Bo Peng wrote:
Dear list,

What I would like to do is something like:

In myModule.py ( a wrapper module for different versions of the module),

  if lib == 'standard':
    from myModule_std import *
  elsif lib == 'optimized'
    from myModule_op import *

but I do not know how to pass variable lib to myModule.py to achieve the following effect:

How about this:
#===== constants.py
lib = whatever   #assigned somewhere else

#===== myModule.py
from constants import lib

etc.

André

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to