background preloader

Python

Facebook Twitter

Learn Python The Hard Way, 2nd Edition — Learn Python The Hard Way, 2nd Edition.

Databases

Security. Python persistence management. Use serialization to store Python objects Patrick O’BrienPublished on November 01, 2002 What is persistence? The basic idea of persistence is fairly simple. Let's say you've got a Python program, perhaps to manage your daily to-do list, and you want to save your application objects (your to-do items) between uses of the program. In other words, you want to store your objects to disk and retrieve them later. For example, you could store your object's data in some kind of formatted text file, such as a CSV file. One thing these storage mechanisms all have in common is that data is stored independent of the objects and programs that operate on the data. For some applications, then, the relational database approach may not be ideal. Object persistence Let's say you like the idea of keeping everything as an object and avoiding the overhead of translating objects into some kind of non-object based storage.

A peck of pickled Python >>> import cPickle as pickle Listing 1. Listing 2. Pickle power. Udacity - Free Classes. Awesome Instructors. Inspiring Community. Python Tutorial.

Pygame