{ "metadata": { "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.0" }, "orig_nbformat": 2, "kernelspec": { "name": "python3", "display_name": "Python 3.10.0 64-bit", "metadata": { "interpreter": { "hash": "0af001259c9085d3649b2fae0bd6b291d17df5c9f127f6973a1b7698b4048c39" } } } }, "nbformat": 4, "nbformat_minor": 2, "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "with open('file1.txt', 'r') as fin, open('file2.txt', 'w') as fout:\n", " fout.write(fin.read())" ] } ] }