Re: [Tutor] How to put my functions in an array

2004-12-30 Thread Mohamed Lrhazi
On Thu, 2004-12-30 at 03:08, Alan Gauld wrote: > > I'm slightly confused about why you need to do this? > You create a list of names (PROVISION_ACTIONS), then > you add the corresponding functions to a dictionary > by looking the names up in the globals dictionary. > But since uyou know the na

Re: [Tutor] How to put my functions in an array

2004-12-29 Thread Mohamed Lrhazi
Thanks alot Jeff. This worked for me: formhandlers={} for verb,verb_desc in PROVISION_ACTIONS: try: formhandlers[verb]=globals()[verb] except KeyError: pass On Wed, 2004-12-29 at 14:37, Jeff Shannon wrote: > If you can't make that change to PROVIS

[Tutor] How to put my functions in an array

2004-12-29 Thread Mohamed Lrhazi
def addvirt(): pass def remvirt(): pass PROVISION_ACTIONS=[('addvirt','Add Virt'),('remvirt','Remove Virt'),] formhandlers={} # this works formhandlers["addvirt"]=addvirt formhandlers["remvirt"]=remvirt # this does not work: for verb,verb_desc in PROVISION_ACTIONS: if cal

Re: [Tutor] About Perl's Integer module

2004-12-17 Thread Mohamed Lrhazi
--On Friday, December 17, 2004 1:49 PM -0800 Jeff Shannon <[EMAIL PROTECTED]> wrote: I don't know perl, so I can't tell for certain, but I think so. However, there are many ways in which this could become more idiomatic Python code, and more efficient. Thanks so much for all the comments and the

[Tutor] About Perl's Integer module

2004-12-17 Thread Mohamed Lrhazi
Hello all, I ported to python a little Perl script that applies some math algorithm that I do not understand... My version seems to give the same results as the Perl version... but just to make sure I am asking the following: The Perl version starts by testing whether Perl is in integer mode or

Re: [Tutor] Equivalent of PHP's __FUNCTION__ ?

2004-12-02 Thread Mohamed Lrhazi
--On Thursday, December 02, 2004 1:42 PM -0500 Kent Johnson <[EMAIL PROTECTED]> wrote: Here is one way to do it, Thanks so much. that's perfect. ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor