Importing into 'containers' namespace

Nikolai Kirsebom nikolai.kirsebom at siemens.no
Thu Jan 4 09:02:22 EST 2001


Thanks, I though of this as a possible solution - but I want to try to
avoid it because:

The application I'm making is a simple DB application consisting of a
set of entities.  I want to make it possible for the user of the
application to define their own 'macros' where Python is the language.


If they define a macro (file like below), the framework object shall
be available when it is 'launched' (by the framework).

#MACRO-FILE:
# Print info on all pupils of supplied age and sex (simplified).

st, a, b = Fw.DialogInputs("Age", "Sex")
if st:
   objs = Fw.GetObjects("Pupil", a, b)
   for obj i objs:
      obj.Print("Some report format")


Initially, I think I will find it easier to convince them (the user)
to use this approach (functional) rather than having to define a class
etc - but if there is no way round - I'll have to somehow go for the
class approach you suggest. (The example uses OO though !!!)

In principle the system should also make it possible to open an
interactive window (like in PythonWin), and in that scope a framework
object should also be available - so the content of the file (above)
could be entered interactively.

Thanks anyway.

Nikolai
   




More information about the Python-list mailing list