Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python opening file modalities

#how you can open a file n python:
open("file_name.file_extension")

# and here's the ways you can access the data from the file:
# r--> read mode
# w--> write mode
# a--> append mode

# r+--> read and write (can't delete parts)--> cursor at the beginning
# w+--> read and write (can delete file parts)
# a+--> read and append (can't delete parts)--> cursor at the end of the file

# n.b.--> to append means that you add something at the end of something else
 
PREVIOUS NEXT
Tagged: #python #opening #file #modalities
ADD COMMENT
Topic
Name
2+6 =