On Nov 16, 3:33 pm, hong zhang <henryzhan...@yahoo.com> wrote: > List, > > I try to assign value to force_mcs sitting in a wildcard subdirectory > /sys/kernel/debug/ieee80211/phy*, but python does not work for that such as: > > os.system("echo %i > /sys/kernel/debug/ieee80211/phy*/iwlagn/data/force_mcs" > % mcs) > > Any right way to do it? > > Thanks. > > --henry
I'd ditch the echo business altogether. 2.x. Not tested. import glob mcs = get_mcs_from_somewhere() for i in glob.glob('/sys/kernel/debug/ieee80211/phy*/iwlagn/data/ force_mcs'): with open(i, 'w') as f: print >>f, mcs Thanks, Jeff mcjeff.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list