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 6839125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:40:50+00:00 2026-05-26T23:40:50+00:00

I feel my recently gained knowledge is still not sufficient when it comes to

  • 0

I feel my recently gained knowledge is still not sufficient when it comes to string processing. Please help me solve the below problem statement:
(Please note:This is the simpler version of my requirement)

So.. I have a file (myoption) with content as below:

day=monday,tuesday,wednesday
month=jan,feb,march,april
holiday=thanksgiving,chirstmas

My python script should be able to read the file and process the read info such that in the end i have three list variables as below:

day --> ['monday','tuesday','wednesday']
month --> ['jan','feb','march','april']
holiday --> ['thanksgiving','christmas']

Please note:
As per my requirement, the format for contents in myoption file should be simple.
Hence You are free to modify the format of ‘myoption’ file without changing the content – This is to give you some flexibility.

Thanks 🙂

  • 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-26T23:40:51+00:00Added an answer on May 26, 2026 at 11:40 pm

    If you use the standard ConfigParser module your data would need to be in INI file format, and so would look something like this:

    [options]
    day = monday,tuesday,wednesday
    month = jan,feb,march,april
    holiday = thanksgiving,christmas
    

    And then you could read the file as follows:

    import ConfigParser
    
    parser = ConfigParser.ConfigParser()
    parser.read('myoption.ini')
    day = parser.get('options','day').split(',')
    month = parser.get('options','month').split(',')
    holiday = parser.get('options','holiday').split(',')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently started to feel that I need to greatly improve my C++
I have recently started exploring Maven, but I feel a bit overwhelmed of all
I've recently switch to MVP pattern with a Passive View approach. I feel it
I feel like I'm missing a fairly fundamental concept to WPF when it comes
Recently, I feel that I've reached a wall I need to vault over to
I was recently approached by my management with an interesting problem - where I
I have recently started learning Ruby, as my first programming language. I feel comfortable
I recently started to think of this problem and I can't find the answer.
I have built a couple of Shoppping Carts with Magento recently but I feel
Recently,I want to lean the linux OS,but whit the awful source code I feel

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.