directory wildcard
Jeff McNeil
jeff at jmcneil.net
Mon Nov 16 16:01:59 EST 2009
On Nov 16, 3:33 pm, hong zhang <henryzhan... at 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
More information about the Python-list
mailing list