def __init__(self, flag): self.es = Elasticsearch('127.0.0.1:9200') self.flag = flag self.file = open(file_name, 'a') self.httptools = EXPHttp()