--- On Mon, 11/16/09, Jeff McNeil <j...@jmcneil.net> wrote:
> From: Jeff McNeil <j...@jmcneil.net> > Subject: Re: directory wildcard > To: python-list@python.org > Date: Monday, November 16, 2009, 3:01 PM > 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 This assigns decimal value, how can I assign Hex here to mcs? > -- http://mail.python.org/mailman/listinfo/python-list