# -*- coding:utf-8 -*-
# Author: WuKong

import sys
import datetime
import itertools
import pandas as pd
from sqlalchemy import create_engine
import multiprocessing as mtp
import os

reload(sys)
sys.setdefaultencoding('utf8')


path = u'C:\\Users\\wangbo\\Desktop\\11月份对账\\赔付表数据\\'
excel_out = pd.ExcelWriter(path + u'每日赔付表-按自然日-账单时间-限制放款时间.xlsx')
df_out = pd.DataFrame()
df_tmp = pd.DataFrame()
for file in os.listdir(path):
    tmp_file = file.replace('.xlsx', '')
    if tmp_file == 'all':
        continue
    else:
        df_out = df_out.append(pd.read_excel(path + file))
df_out.to_excel(excel_out, sheet_name='sheet1', columns=df_out.columns, index=None, encoding='utf8')
excel_out.save()



path = u'C:\\Users\\wangbo\\Desktop\\11月份对账\\赔付表渤海\\'
excel_out = pd.ExcelWriter(path + u'每日赔付表-按自然日-账单时间-限制放款时间_渤海.xlsx')
df_out = pd.DataFrame()
df_tmp = pd.DataFrame()
for file in os.listdir(path):
    tmp_file = file.replace('.xlsx', '')
    if tmp_file == 'all':
        continue
    else:
        df_out = df_out.append(pd.read_excel(path + file))
df_out.to_excel(excel_out, sheet_name='sheet1', columns=df_out.columns, index=None, encoding='utf8')
excel_out.save()