代码拉取完成,页面将自动刷新
# -*- coding: utf-8 -*-
"""
Created on Thu Nov 8 09:34:13 2018
@author: Administrator
"""
import pandas as pd
import os
from datetime import datetime
current_date = str(datetime.now()).split('.')[0].split(' ')[0]
data_path = r'D:\test' + '\\'
file_name = '修改切换模式_2018-11-08.xlsx'
df_file = pd.read_excel(data_path + file_name ,encoding='utf-8')
# =============================================================================
# 生成ommb1修改指令
# =============================================================================
df_ommb1 = df_file[df_file['OMMB'] == 'OMMB1']
df_ommb1 = df_ommb1.reset_index()
with open(data_path + current_date + '_' + 'apply_right_OMMB1.txt','a') as f:
for i in range(0,len(df_ommb1),1):
line = r'APPLY MUTEXRIGHT:SUBNET="{0}",NE="{1}";'\
.format(df_ommb1.loc[i,'SubNetwork'],
df_ommb1.loc[i,'MEID'],
)
f.write(line+'\n')
with open(data_path + current_date + '_' + 'OMMB1_command.txt','a') as f:
for i in range(0,len(df_ommb1),1):
line = r'UPDATE:MOC="EUtranCellFDD",MOI="{0}",ATTRIBUTES="flagSwiMode=6",EXTENDS="";'\
.format(df_ommb1.loc[i,'MOI'])
f.write(line+'\n')
# =============================================================================
# 生成ommb1修改指令
# =============================================================================
df_ommb2 = df_file[df_file['OMMB'] == 'OMMB2']
df_ommb2 = df_ommb2.reset_index()
with open(data_path + current_date + '_' + 'apply_right_OMMB2.txt','a') as f:
for i in range(0,len(df_ommb2),1):
line = r'APPLY MUTEXRIGHT:SUBNET="{0}",NE="{1}";'\
.format(df_ommb2.loc[i,'SubNetwork'],
df_ommb2.loc[i,'MEID'],
)
f.write(line+'\n')
with open(data_path + current_date + '_' + 'OMMB2_command.txt','a') as f:
for i in range(0,len(df_ommb2),1):
line = r'UPDATE:MOC="EUtranCellFDD",MOI="{0}",ATTRIBUTES="flagSwiMode=6",EXTENDS="";'\
.format(df_ommb2.loc[i,'MOI'])
f.write(line+'\n')
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。