Re: python with echo

2009-11-12 Thread MRAB
Steven D'Aprano wrote: On Thu, 12 Nov 2009 19:30:01 +, MRAB wrote: I don't understand that. Exit status codes on all systems I'm familiar with are limited to 0 through 255. What operating system are you using? Assuming your system allows two-byte exit statuses, you should check the documen

Re: python with echo

2009-11-12 Thread Steven D'Aprano
On Thu, 12 Nov 2009 19:30:01 +, MRAB wrote: >> I don't understand that. Exit status codes on all systems I'm familiar >> with are limited to 0 through 255. What operating system are you using? >> >> Assuming your system allows two-byte exit statuses, you should check >> the documentation for

Re: python with echo

2009-11-12 Thread Christian Heimes
Diez B. Roggisch wrote: > with open("/sys/class/net/wlan1/device/tx_power", "w") as f: > f.write("%i" % POWER) IIRC the sys and proc virtual file system requires new line at the end of a modifier. At least echo appends \n unless it's told otherwise. Christian -- http://mail.python.org/mail

Re: python with echo

2009-11-12 Thread Hans Mulder
Steven D'Aprano wrote: On Wed, 11 Nov 2009 17:24:37 -0800, hong zhang wrote: List, I have a question of python using echo. POWER = 14 return_value = os.system('echo 14 > /sys/class/net/wlan1/device/tx_power') can assign 14 to tx_power But return_value = os.system('echo $POWER > /sys/class/n

Re: python with echo

2009-11-12 Thread MRAB
Steven D'Aprano wrote: On Wed, 11 Nov 2009 17:24:37 -0800, hong zhang wrote: List, I have a question of python using echo. POWER = 14 return_value = os.system('echo 14 > /sys/class/net/wlan1/device/tx_power') can assign 14 to tx_power But return_value = os.system('echo $POWER > /sys/class/n

Re: python with echo

2009-11-12 Thread Diez B. Roggisch
hong zhang schrieb: List, I have a question of python using echo. POWER = 14 return_value = os.system('echo 14 > /sys/class/net/wlan1/device/tx_power') can assign 14 to tx_power But return_value = os.system('echo $POWER > /sys/class/net/wlan1/device/tx_power') return_value is 256 not 0. It

Re: python with echo

2009-11-11 Thread Steven D'Aprano
On Wed, 11 Nov 2009 17:24:37 -0800, hong zhang wrote: > List, > > I have a question of python using echo. > > POWER = 14 > return_value = os.system('echo 14 > > /sys/class/net/wlan1/device/tx_power') > > can assign 14 to tx_power > > But > return_value = os.system('echo $POWER > > /sys/class/n

Re: python with echo

2009-11-11 Thread MRAB
hong zhang wrote: List, I have a question of python using echo. POWER = 14 return_value = os.system('echo 14 > /sys/class/net/wlan1/device/tx_power') can assign 14 to tx_power But return_value = os.system('echo $POWER > /sys/class/net/wlan1/device/tx_power') return_value is 256 not 0. It c

Re: python with echo

2009-11-11 Thread Himanshu
2009/11/12 hong zhang : > List, > > I have a question of python using echo. > > POWER = 14 > return_value = os.system('echo 14 > /sys/class/net/wlan1/device/tx_power') > > can assign 14 to tx_power > > But > return_value = os.system('echo $POWER > /sys/class/net/wlan1/device/tx_power') > > return_v