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

  • Home
  • SEARCH
  • 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 3943666
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:48:32+00:00 2026-05-20T00:48:32+00:00

In experimenting with pickle, I’ve put together some code for a (very) simple blog.

  • 0

In experimenting with pickle, I’ve put together some code for a (very) simple blog. It’s intended to display time-stamped blog contents from a pickle’d list in reverse chron order. It then prompts whether you want to add to the blog. (As you can see, I’m new to programming). Please critique this and/or suggest ways to make this even more efficient. This was written for Python 2.7. Also, I’ve saved this as Journal.py. I call it by issuing “reload(Journal)”. How would I call this module without the “reload” command ?Thank you.

import pickle
import time
from time import strftime


archive_log = []
new_log = []

with open('journal.pickle','r') as f:
    archive_log = pickle.load(f)
    for item in reversed(archive_log):
        print item

proceed = 'y'
cont = []
while proceed == 'y':
    cont = raw_input('Add an entry ? ')
    if cont == 'n':
        break
    else:
        new_log = (strftime('%Y%m%d %H:%M:%S *%a* ') + raw_input('Enter new info '))
        archive_log.append(new_log)
        with open('journal.pickle', 'w') as f:
            pickle.dump(archive_log, f)
  • 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-20T00:48:33+00:00Added an answer on May 20, 2026 at 12:48 am

    To answer your immediate question, you can run this code by using:

    python Journal.py
    

    and things should mostly work (I didn’t test your code, just glanced at it). To improve upon it, you should look at Guido’s guide to using main() here and possibly utilizing a #! (reference) so you can do:

    ./Journal.py
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing some experimenting (so the code below has lots of stuff that
I've been experimenting with Adobe Flex recently. Being a long-time server-side web app developer,
Experimenting using different approaches and reducing code maintenance I have ended up using reflection
Experimenting with existential types. Seems to be a great way to get some type
After experimenting with an iterator block I noticed the generated IL code is not
While experimenting with pixel shaders in WPF I decided to draw some pixels onto
Experimenting with new features of T-SQL, I've run into a puzzle. Here is some
I am experimenting with the c-language right at the moment, yet i have some
While experimenting with this question on collections in Spring.NET , I discovered that Spring
I have been experimenting with woopra.com A web analytics tool. Which requires a piece

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.