Re: Python: Making A Program Run A Function That Is Not Hard Coded

  • From: "black ares" <matematicianu2003@xxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Thu, 2 Dec 2010 15:22:17 +0200

i don't know in PYThon, but if PYTHON is as dynamic as php, yes it is posible.
in php I simply
write "function"();
and the method is appeled, if not, the method __Call is appeled.

  ----- Original Message ----- 
  From: Homme, James 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Thursday, December 02, 2010 2:54 PM
  Subject: Python: Making A Program Run A Function That Is Not Hard Coded


  Hi,

  I'm trying to be clear about this question, but maybe this can't be done. 

   

  Let's say that you have a list that contains twenty strings. 

  Your program reads in a string from a file.

  The string from the file matches one of the strings in your list.

  You want to perform a function that may be associated with that string.

  You don't want to write twenty if statements to see if the string in the file 
matches and perform the function associated with that string.

  You want to somehow get the program to see the string and the function 
associated with it and just perform it.

   

  Is this possible?

   

  Thanks.

   

  Jim

   

  Jim Homme,

  Usability Services,

  Phone: 412-544-1810. Skype: jim.homme

  Internal recipients,  Read my accessibility blog. Discuss accessibility here. 
Accessibility Wiki: Breaking news and accessibility advice

   



------------------------------------------------------------------------------
  This e-mail and any attachments to it are confidential and are intended 
solely for use of the individual or entity to whom they are addressed. If you 
have received this e-mail in error, please notify the sender immediately and 
then delete it. If you are not the intended recipient, you must not keep, use, 
disclose, copy or distribute this e-mail without the author's prior permission. 
The views expressed in this e-mail message do not necessarily represent the 
views of Highmark Inc., its subsidiaries, or affiliates.

Other related posts: