python
f = open('test.text', 'w')
f.write('test test test\n')
print('This', 'is', 'test', sep='#', end='!', file=f)
f.close()
Execution result
test.A file called text is created,
The contents are
test test test
This#is#test!
Will be.
Recommended Posts