How to pass parameter to a module?

M-a-S NO-MAIL at
Thu Sep 18 12:11:01 CEST 2003

I'd like to parametrize a module. That is, to set and pass
some values into the module, while it is being imported.
I tried this:

  # -- main program
  extern = "OK"
  import sub_2
  print sub_2.noway # prints 'no extern' :-(
  # EOF

  # -- parametrized module, parameter is the 'extern' var
     noway = extern
     noway = 'no extern'
  # EOF

You can guess, it doesn't work.
How can I pass the parameter? Can I?

More information about the Python-list mailing list