def pickle_save(data, file):
    """
    @brief      Use pickle to save python object into file
    @param      data  The pyhton data
    @param      file  The file
    """
    basedir = os.path.dirname(file)
    if not os.path.exists(basedir):
        os.makedirs(basedir)
    with open(file, 'wb') as f:
        pickle.dump(data, f, pickle.HIGHEST_PROTOCOL)

    @brief      Use pickle to save python object into file
    @param      data  The pyhton data
    @param      file  The file
    
wxbot_project_py2.7/wechat/utils.py