ops_interface/data_channel/produce_ss_csv.py
2019-10-23 15:01:14 +08:00

32 lines
815 B
Python

# -*- coding: utf-8 -*-
import pdb
from ops.mpsetting import Mpdata
class ProduceSSCsv:
def __init__(self):
# self.base_path = "/data/git/ops_interface/ops/csv"
self.base_path = "/tmp/"
self.gameid_list = [1004, 1001, 2001, 1011]
self.channelid = 6001
def write2csv(self, gameid, channelid, data):
filename = f"{gameid}_{channelid}__button_name.csv"
with open(filename, 'w') as f:
f.write("button_name,button_name_cn\n")
for line in data:
print(line)
def run(self):
mi = Mpdata()
for gameid in self.gameid_list:
data = mi.get_co_list(gameid, self.channelid)
self.write2csv(gameid, self.channelid, data)
if __name__ == "__main__":
pp = ProduceSSCsv()
pp.run()