尝试此脚本,但出现错误'SyntaxError:无法分配给文字”
import pandas as pd
import glob
1 = [pd.read_csv(filename, sep='\s+', header=0, usecols=[1, 2, 7], names=["VLAN", "MAC", "INTERF"]) for filename in glob.glob("c:/sw_mac_addr/*.txt")]
df = pd.concat(1,axis=0)
df.to_csv('c:/sw_mac_addr/test.csv')