コード例 #1
0
def read_pickle():
    userId_f = None
    businessId_f = None
    userId_c = None
    businessId_c = None
    if os.path.exists(userIdConversionPathStr):
        userId_f = file(userIdConversionPathStr, 'r+')
        userId_c = pickle.load(userId_f)
    else:
        userId_f = file(userIdConversionPathStr, 'w')
        userId_c = conversion.userIdConversion()
    if os.path.exists(businessIdConversionPathStr):
        businessId_f = file(businessIdConversionPathStr, 'r+')
        businessId_c = pickle.load(businessId_f)
    else:
        businessId_f = file(businessIdConversionPathStr, 'w')
        businessId_c = conversion.businessIdConversion()
    return userId_f, userId_c, businessId_f, businessId_c
コード例 #2
0
def read_pickle():
    userId_f = None
    businessId_f = None
    userId_c = None
    businessId_c = None
    if os.path.exists(userIdConversionPathStr):
        userId_f = file(userIdConversionPathStr, 'r+')
        userId_c = pickle.load(userId_f)
    else:
        userId_f = file(userIdConversionPathStr, 'w')
        userId_c = conversion.userIdConversion()
    if os.path.exists(businessIdConversionPathStr):
        businessId_f = file(businessIdConversionPathStr, 'r+')
        businessId_c = pickle.load(businessId_f)
    else:
        businessId_f = file(businessIdConversionPathStr, 'w')
        businessId_c = conversion.businessIdConversion()
    return userId_f, userId_c, businessId_f, businessId_c