Log in or register to post comments In Python, by using the ‘with’ statement, you can open a file and close it as soon as the block of code, where ‘with’ is used, exits. In this way, you can opt to not use the close() method. Tags Python File Handling Interview Questions Python Interview Questions