python with echo

Christian Heimes lists at cheimes.de
Thu Nov 12 17:31:00 EST 2009


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




More information about the Python-list mailing list