dasda

LSW1交换机配置

<Huawei>sys    //进入系统视窗
[Huawei]undo info-center enable    //关闭输出信息
[Huawei]sysname LSW1    //改名
[LSW1]interface Eth-Trunk 1    //创建Eth-Trunk 1接口
[LSW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/3    
//将g0/0/1到g0/0/3加入到Eth-Trunk 1
[LSW1-Eth-Trunk1]quit    //退出
[LSW1]vlan batch 10 20    //创建vlan10 20
[LSW1]interface g0/0/4    //进入到g0/0/4接口
[LSW1-GigabitEthernet0/0/4]port link-type access    //设置access模式
[LSW1-GigabitEthernet0/0/4]port default vlan 10    //将接口分配给vlan10
[LSW1-GigabitEthernet0/0/4]quit    //退出
[LSW1]interface g0/0/5    //进入g0/0/5接口
[LSW1-GigabitEthernet0/0/5]port link-type access    //设置access模式
[LSW1-GigabitEthernet0/0/5]port default vlan 20    //将接口分配给vlan20
[LSW1-GigabitEthernet0/0/5]quit    //退出
[LSW1]interface Eth-Trunk 1    //配置接口
[LSW1-Eth-Trunk1]port link-type trunk
[LSW1-Eth-Trunk1]port trunk allow-pass vlan 10 20    //允许vlan10和vlan20通过
[LSW1-Eth-Trunk1]quit
[LSW1]interface Eth-Trunk 1    //配置接口
[LSW1-Eth-Trunk1]load-balance src-dst-mac   
 //配置负载分担方式基于源mac地址和目的mac地址进行Hash计算选择路径
[LSW1-Eth-Trunk1]quit
[LSW1]display Eth-Trunk 1    //检查创建的Eth-Trunk
[LSW1]display interface Eth-Trunk 1    //查看Eth-Trunk的带宽

LSW2交换机配置

<Huawei>sys    //进入系统视窗
[Huawei]undo info-center enable    //关闭输出信息
[Huawei]sysname LSW2    //改名
[LSW2]interface Eth-Trunk 1    //创建Eth-Trunk 1接口
[LSW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/3
//将g0/0/1到g0/0/3加入到Eth-Trunk 1
[LSW2-Eth-Trunk1]quit    //退出
[LSW2]vlan batch 10 20    //创建vlan10 20
[LSW2]interface g0/0/4    //进入到g0/0/4接口
[LSW2-GigabitEthernet0/0/4]port link-type access    //设置access模式
[LSW2-GigabitEthernet0/0/4]port default vlan 10    //将接口分配给vlan10
[LSW2-GigabitEthernet0/0/4]quit
[LSW2]interface g0/0/5    //进入g0/0/5接口
[LSW2-GigabitEthernet0/0/5]port link-type access    //设置access模式
[LSW2-GigabitEthernet0/0/5]port default vlan 20    //将接口分配给vlan20
[LSW2-GigabitEthernet0/0/5]quit
[LSW2]interface Eth-Trunk 1    //配置接口
[LSW2-Eth-Trunk1]port link-type trunk
[LSW2-Eth-Trunk1]port trunk allow-pass vlan 10 20    //允许vlan10和vlan20通过
[LSW2-Eth-Trunk1]quit
[LSW2]interface Eth-Trunk 1    //配置接口
[LSW2-Eth-Trunk1]load-balance src-dst-mac
 //配置负载分担方式基于源mac地址和目的mac地址进行Hash计算选择路径
[LSW2-Eth-Trunk1]

  • 5
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
好的,以下是改造后的代码,使用正则表达式去除特殊符号和非法字符: import os import zipfile import pandas as pd import re def zipjie(): f = zipfile.ZipFile("E:\dsad\dsad据\d8.rar", 'r') # 压缩文件位置 for file in f.namelist(): f.extract(file, "E:\dsad\dsad据") # 解压位置 f.close() # 指定要查找的文件夹路径 folder_path = "E:\王dsad\dsad据" # 指定要选取的字段 selected_columns = ['dsad', 'dasda','工dadsa'] # 使用 os 模块列出文件夹中所有的 XLS 文件 xls_files = [f for f in os.listdir(folder_path) if f.endswith('.xls')] # 创建一个新的 Excel 文件 writer = pd.ExcelWriter('E:\dsad\dsad据\qwd.xlsx') # 循环对每个 XLS 文件进行操作 for xls_file in xls_files: # 构造文件路径 file_path = os.path.join(folder_path, xls_file) # 使用 pandas 打开 XLS 文件 df = pd.read_excel(file_path) # 选取指定的字段,并判断,若不存在的字段跳过 valid_columns = [col for col in selected_columns if col in df.columns] if len(valid_columns) < len(selected_columns): print(f"Warning: {xls_file} contains invalid column names, skipping them") # 去除特殊符号和非法字符 for col in valid_columns: df[col] = df[col].apply(lambda x: re.sub(r'[^\w\s]','',str(x))) df[col] = df[col].apply(lambda x: re.sub(r'[\d]', '', str(x))) selected_data = df[valid_columns] # 将选取的数据写入到新的 Excel 文件中 selected_data.to_excel(writer, sheet_name=xls_file) # 保存并关闭新的 Excel 文件 writer.save() writer.close() zipjie()

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值