4 ms·
One of the handy things not mentioned: with open("x.txt") as f: data = f.read() # do something with data
by udev 13y ago
One of the handy things not mentioned:
with open("x.txt") as f:
data = f.read()
# do something with data
- theophrastus 13y agoabsolutely! that one is quite high up on my python_idioms_to_import file