@@ -0,0 +1,1319 @@
+__author__ = 'Georgios Rizos (georgerizos@iti.gr)'%0A%0Atry:%0A    import cPickle as pickle%0Aexcept ImportError:%0A    import pickle%0A%0A%0Adef get_file_row_generator(file_path, separator, encoding=None):%0A    %22%22%22%0A    Reads an separated value file row by row.%0A%0A    Inputs: - file_path: The path of the separated value format file.%0A            - separator: The delimiter among values (e.g. %22,%22, %22%5Ct%22, %22 %22)%0A            - encoding: The encoding used in the stored text.%0A%0A    Yields: - words: A list of strings corresponding to each of the file's rows.%0A    %22%22%22%0A    with open(file_path, encoding=encoding) as file_object:%0A        for line in file_object:%0A            words = line.strip().split(separator)%0A            yield words%0A%0A%0Adef store_pickle(file_path, data):%0A    %22%22%22%0A    Pickle some data to a given path.%0A%0A    Inputs: - file_path: Target file path.%0A            - data: The python object to be serialized via pickle.%0A    %22%22%22%0A    pkl_file = open(file_path, 'wb')%0A    pickle.dump(data, pkl_file)%0A    pkl_file.close()%0A%0A%0Adef load_pickle(file_path):%0A    %22%22%22%0A    Unpickle some data from a given path.%0A%0A    Input:  - file_path: Target file path.%0A%0A    Output: - data: The python object that was serialized and stored in disk.%0A    %22%22%22%0A    pkl_file = open(file_path, 'rb')%0A    data = pickle.load(pkl_file)%0A    pkl_file.close()%0A    return data%0A

Update read/write data utilities #3.