python读取一个文件并写入另一个文件_从文件读取并写入另一个python
你只读取了一行输入。所以,最多只能有一行输出。在我看你的代码有点“老派”。这是一个更“现代”和Python的版本。在# Modern way to open files. The closing in handled cleanlywith open('inventory.txt', mode='r') as in_file, \open('purchasing.txt', mode='w') a...