Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:47

0001 from __future__ import print_function
0002 __author__="Aurelija"
0003 __date__ ="$2010-07-26 12.51.12$"
0004 
0005 from os.path import join
0006 import pickle
0007 import os
0008 
0009 def createPickleFile(fileName, listRule, path = os.getcwd()):
0010 
0011     dict = {}
0012     
0013     try:
0014         for filePath, lines in listRule:
0015            dict[filePath] = lines
0016         file = open(join(path, fileName), 'wb')
0017         pickle.dump(dict, file)
0018         file.close()
0019     except TypeError:
0020         print('Wrong types')
0021     except IOError:
0022         print('Cannot open %s file'%fileName)