Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

file handling in python append byte

file = open('myfile.dat', 'wb')
file.write('This is a sample')
file.close()

file = open('myfile.dat', 'ab')
file.seek(5)
file.write(' text')
file.close()

file = open('myfile.dat', 'rb')
print file.read()  # -> This is a sample text
Comment

PREVIOUS NEXT
Code Example
Python :: python redis delete many 
Python :: python booleans 
Python :: np.all 
Python :: python permission denied on mac 
Python :: guessing game python 
Python :: how to perform group by with django orm 
Python :: for in loop python 
Python :: primes python 
Python :: putting in text in python 
Python :: length of dictionary in python 
Python :: variable globale python 
Python :: call javascript function flask 
Python :: binary search tree in python 
Python :: create pdf in python 
Python :: python string lenght 
Python :: dataframe.fillna 
Python :: django migrations 
Python :: what is best app for Python 
Python :: python strip() 
Python :: np.append 
Python :: generate python 
Python :: what does the combinations itertools in python do 
Python :: max value of a list prolog 
Python :: django reverse vs reverse_lazy 
Python :: class decorator python 
Python :: python split() source code 
Python :: aws lambda logging with python logging library 
Python :: list all files in a folder 
Python :: tensorflow data augmentation 
Python :: what is serializer in django 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =