File creation

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

File creation
Linebot creation & file sharing in Python
File matching
Read file
File operations
TFRecord file creation memorandum for object detection
Script python file
UNIX file descriptor
syslog file rename
[Day 4] Application creation
django table creation
Duplicate file removal
Python file processing
Empty file detection
[Linux] File search
astropy: fits file
Nginx config file
Folder creation / file move / compress / delete operations with python