<div class="gmail_quote">On Tue, Dec 1, 2009 at 3:17 PM, Jean-Michel Pichavant <span dir="ltr"><<a href="mailto:jeanmichel@sequans.com">jeanmichel@sequans.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">Victor Subervi wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi;<br>
I have the following code that execute without a problem:<br>
<br>
import sys,os<br>
sys.path.append(os.getcwd())<br>
import options<br>
storesTables = []<br>
junkStores = string.join(addStore(), ', ')<br>
for table in optionsTables():<br>
  if table not in ('particulars', junkStores):<br>
    storesTables.append(table)<br>
for table in storesTables:<br>
  try:<br>
    fn = getattr(options, table)<br>
    print fn()<br>
  except:<br>
    pass<br>
<br>
I need to change the obvious line to this or something similar (that actually works):<br>
<br>
    fn = getattr(options, '%s("names")' % table)<br>
<br>
That is, I need to pass the variable "names" to each table as it is called. How do I do this?<br>
TIA,<br>
Victor<br>
</blockquote></div></div>
I'm not sure I understood what your are trying to do.<div class="im"><br>
<br>
 try:<br>
   fn = getattr(options, table)<br></div>
   fn(names)<br>
 except:<br>
   pass<br></blockquote><div><br>Thank you.<br>V<br></div></div>