title: How to pass variables to another function in another module
body: <p>I'm relatively new to python and I'm running into some trouble passing variables to a function in a new module/program I wrote. </p>
  
  <p>I'm working with 2 separate programs/modules here: <code>xmlgen.py</code> and <code>JobHandler.py</code>. Jobhandler has to pass variables from one of it's functions to a function in xmlgen <em>(so that <code>xmlgen.py</code> can generate an xml document based on the variables in <code>JobHandler.py</code>)</em>. </p>
  
  <p>Here is the function in <code>xmlgen.py</code>:</p>
  
  <pre><code>from lxml import etree
  from Faxer import coverPage, ourOrg, ourPhonenum, ourFaxnum, emailAddr, 
  sendReceipt, webAddr, comments
  
  def generateXml(destOrg, destFax, cliName, casenum, attachments, errEAddr, comment, destName):
      #xml file structure
      root = etree.Element('schedule_fax')
  
      #***
      #irrelevant xml stuff
      #***
  
      grandchild_recipient_name = etree.Element('name')
      grandchild_recipient_name.text = cliName
      child_recipient.append(grandchild_recipient_name)
  
      #more similar xml fields with the other variables used
  </code></pre>
  
  <p>Here's the function I made in the main <code>JobHandler.py</code> program, to pass variables as arguments from a previous function to <code>generateXml()</code> in xmlgen module. The arguments <em>(job.destOrg, etc.)</em> were defined previously in the main jobhandler program, in an earlier function.</p>
  
  <pre><code>def createXml(self, job):
      xmlgen.generateXml(job.destOrg, job.destFax, job.cliName, job.casenum, job.files, job.staffEmail, job.comment, job.destName)
  </code></pre>
  
  <p>Now when I run this, the xml document is not created. I know it works, because when I remove the function from xmlgen.py and just run it, it creates a blank xml doc properly. So I suspect I'm not calling the function properly. Is there something I'm not doing that's necessary to actually CALL the function?</p>