directory wildcard

hong zhang henryzhang62 at yahoo.com
Mon Nov 16 17:19:16 EST 2009



--- On Mon, 11/16/09, Jeff McNeil <jeff at jmcneil.net> wrote:

> From: Jeff McNeil <jeff at jmcneil.net>
> Subject: Re: directory wildcard
> To: python-list at python.org
> Date: Monday, November 16, 2009, 3:01 PM
> 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

This assigns decimal value, how can I assign Hex here to mcs?
> 


      



More information about the Python-list mailing list