vsergeev / python-periphery

A pure Python 2/3 library for peripheral I/O (GPIO, LED, PWM, SPI, I2C, MMIO, Serial) in Linux.
MIT License
529 stars 139 forks source link

use with statement to process files #2

Closed SanketDG closed 9 years ago

SanketDG commented 9 years ago

From python 2.5, the with statement is advised to use, because it automatically closes the files when everything inside the with block is executed. Also, its scope remains shorter.

vsergeev commented 9 years ago

Thanks -- merged in 8ac7b40.