Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python how to make a file to write to

# Basic syntax:
file_object = open("filename", "mode")
file_object.write("Data to be written")
file_object.close() 

# Example usage:
file_object = open("/path/to/my_filename.txt", "w") # w = write, r = read
file_object.write("Line of text to write")
file_object.close()
Source by www.guru99.com #
 
PREVIOUS NEXT
Tagged: #python #file #write
ADD COMMENT
Topic
Name
4+6 =