title: How to access files inside a Python egg file?
body: <p>This might be a weird requirement but it's what I've run into. I Googled but yield nothing.</p>
  
  <p>I'm coding an application who's using a lot of constant attributes / values recorded in an XML file (they'll not change so a static file), things work fine until I generated an egg file for it.</p>
  
  <p>When the logic reaches the XML accessing part, I got one complaint like this:
  /home/Workspace/my_proj/dist/mps-1.2.0_M2-py2.6.egg/mps/par/client/syntax/syntax.xml</p>
  
  <p>Actually I've bundled the XML file in the path above but seems Python doesn't know how to access it.</p>
  
  <p>The code to access the XML is as...</p>
  
  <pre><code>file_handler = open(path_to_the_file)
  lines = file_handler.read().splitlines()
  </code></pre>
  
  <p>Any idea?</p>