SHARE
Facebook X Pinterest WhatsApp

Python4Kids: New Tutorial – An Awful Pickle

Written By
thumbnail
Web Webster
Web Webster
Feb 7, 2011

[ Thanks to Brendan Scott for this
link. ]

“So, we know how to save trivia questions to a file,
and how to read them back from a file in the future. Moreover, we
have decided on a particular way of structuring the data which
makes a question. That is, the question is followed by the correct
answer and then a number of incorrect answers. Now we have to
translate between a list (which has a concept of elements), and a
file (which doesn’t). Files are “flat” – which is to say that
they have no sense of structure, they are simply a stream of data.
A file may record all of the characters which are the questions and
answers, but it wouldn’t record the fact that they are a list or,
indeed, that they are any kind of Python object. I was originally
just going to run with this to let you find out about files, but I
have instead decided to introduce a further concept – the
Python pickle!

“pickle is a module which allows you to store Python objects
including their structure. That means after you have pickled an
object to a file, you can later load that object back up from the
file and all the structure associated with that object will be
preserved.”

Complete
Story

thumbnail
Web Webster

Web Webster

Web Webster has more than 20 years of writing and editorial experience in the tech sector. He’s written and edited news, demand generation, user-focused, and thought leadership content for business software solutions, consumer tech, and Linux Today, he edits and writes for a portfolio of tech industry news and analysis websites including webopedia.com, and DatabaseJournal.com.

Recommended for you...

5 Best Free and Open Source Text Expander Tools
webmaster
Jun 13, 2025
Grafito: Systemd Journal Log Viewer with a Beautiful Web UI
Bobby Borisov
Jun 12, 2025
FreeBSD Wants to Know a Few Things
brideoflinux
May 11, 2025
NVK enabled for Maxwell, Pascal, and Volta GPUs
Kara Bembridge
May 1, 2025
Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2025 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.