
- Imported tempfile module to create a temporary file. - Replaced the creation of 'test.txt' in the current directory with a temporary file. - The temporary file is automatically deleted when it is closed, eliminating the need for manual deletion.
- Imported tempfile module to create a temporary file. - Replaced the creation of 'test.txt' in the current directory with a temporary file. - The temporary file is automatically deleted when it is closed, eliminating the need for manual deletion.