Re: Shed my a light :)

2008-06-02 Thread TheSaint
On 22:00, lunedì 02 giugno 2008 Paul Melis wrote: > This doesn't exactly make sense, as what you want isn't really clear... Sorry, I'm bad to express my toughts even I my nature language :) I'll give a go to getattr() and see whether the results come in my taste :) -- Mailsweeper Home : http://i

Re: Shed my a light :)

2008-06-02 Thread Paul Melis
TheSaint wrote: On 19:06, lunedì 02 giugno 2008 Chris wrote: actions= ('print', 'sum', 'divide', 'myfunction') parameters=(5, 'nothing',5.63, object) 8< 8< getattr(...) getattr(object, name[, default]) -> value 8< 8< for nn in actions: func = getattr(cp, nn) if callable(func)

Re: Shed my a light :)

2008-06-02 Thread TheSaint
On 19:06, lunedì 02 giugno 2008 Chris wrote: >> actions= ('print', 'sum', 'divide', 'myfunction') >> parameters=(5, 'nothing',5.63, object) 8< 8< > getattr(...) > getattr(object, name[, default]) -> value 8< 8< > for nn in actions: > func = getattr(cp, nn) > if callable(func): >

Re: Shed my a light :)

2008-06-02 Thread Duncan Booth
TheSaint <[EMAIL PROTECTED]> wrote: > actions= ('print', 'sum', 'divide', 'myfunction') > parameters=(5, 'nothing',5.63, object) > > for routines in actions: > routines(parameters) > > I'd like to note that actions are string or string expressions of the > program functions or python itself

Re: Shed my a light :)

2008-06-02 Thread Chris
On Jun 2, 12:35 pm, TheSaint <[EMAIL PROTECTED]> wrote: > Hi, > I using eval for quite strange reason, as long as I don't know a different > way to implement. > > An example: > > actions= ('print', 'sum', 'divide', 'myfunction') > parameters=(5, 'nothing',5.63, object) > > for routines in actions:

Shed my a light :)

2008-06-02 Thread TheSaint
Hi, I using eval for quite strange reason, as long as I don't know a different way to implement. An example: actions= ('print', 'sum', 'divide', 'myfunction') parameters=(5, 'nothing',5.63, object) for routines in actions: routines(parameters) I'd like to note that actions are string or st