# Old way
file = open("somefile")
try:
print file.readline(),
finally:
file.close()
# New way
with open("somefile") as file:
print file.readline(),
Essentially, the "with" block enables you to add an enter and exit clause to an object. In the case of the file object, the exit clause closes the file.
This has a number of advantages. Opening files is the obvious one, but any other type of IO operation also benefits. For instance, one could put a database cursor in a "with" block, and automatically have it rollback any operations if an exception occurs. Also, OpenGL has a lot of "StartSomething()" and "EndSomething()" functions that could be wrapped up in a with block.
So it's pretty neat. It makes your code easier to read, and ensures you never forget to properly close/rollback/stop an operation.