directory wildcard

Diez B. Roggisch deets at nospam.web.de
Mon Nov 16 15:54:36 EST 2009


hong zhang schrieb:
> 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?

Don't use os system. Use subprocess. Which incidentially is mentioned in 
the docs for os.system:

   http://docs.python.org/library/os.html#os.system

Then you can pass the "use_shell=True" parameter - which should work in 
your case.

Diez



More information about the Python-list mailing list