Programming and Algorithms: Week 31

Banner
Strings and serialization part 2

What are we doing this week?


This week we are going to look at how Python does FILE MANAGEMENT, and also how it manages EXCEPTION HANDLING, and from there SERIALIZING OBJECTS.

Python Python Logo



Powerpoint: File Management


Powerpoint: Exception Handling


Powerpoint: Serializing Objects



Total running time of videos is 45 minutes.

Sample Code:
File Reading (Example 1, Example 2, Example 3, Example 4, Example 5, Example 6, Example 7) * Binary File Reading * File Writing (Example 1, Example 2, Example 3, Example 4, Example 5) * Exception Handling (Example 1, Example 2, Example 3, Example 4, Example 5, Example 6, Example 7)

Sample Files:
MyData.txt * MyData2.txt * Python.gif

Sample Code:
Serializing Objects


Pickles


Serialization with Pickle



Links
Python Wiki: Using Pickle
https://wiki.python.org/moin/UsingPickle

PyMOTW: Pickle and Cpickle
https://pymotw.com/2/pickle/

Ben Frederickson: Don't Pickle Your Data
http://www.benfrederickson.com/dont-pickle-your-data/


Lab #31
Lab #31 is all about checking if what you have learned in the episodes above all makes sense, and if you can use Python's pickling features.




Back

If you have any suggestions, corrections, or comments, please feel free to e-mail me at:
Damian.Gordon(a)dit.ie