Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1062505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:38:14+00:00 2026-05-16T18:38:14+00:00

This might be a weird requirement but it’s what I’ve run into. I Googled

  • 0

This might be a weird requirement but it’s what I’ve run into. I Googled but yield nothing.

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.

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

Actually I’ve bundled the XML file in the path above but seems Python doesn’t know how to access it.

The code to access the XML is as…

file_handler = open(path_to_the_file)
lines = file_handler.read().splitlines()

Any idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:38:15+00:00Added an answer on May 16, 2026 at 6:38 pm

    egg files are zipfiles, so you must access “stuff” inside them with the zipfile module of the Python standard libraries, not with the built-in open function!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok, this might be a weird request, but is it possible to essentially flatten
This might seem like a weird question, but bear with me. I'd like to
This might seem a bit weird, but since I am new in RoR and
This might be a weird question, but I'll try anyway. I set up my
This might sound weird, but when I open a solution that I dont know,
This question might sound weird, but how do I make a job fail? I
So, this might be a weird thing to try to do, but I'm curious
this might sound weird but instead of adding additional files when the user is
this is might be really weird, but I have no idea what kinda wizardry
I feel this might be a weird/stupid question, but here goes... In the question

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.