Make transmit.py use the with... as... syntax