file resume

L

luca72

Hello at all:
if i have one file written in binary mode, how can i append others
binary data to this file after the its closure.
ex
my_file = open('blabal', 'wb')
then i write something and then
my_file.close()
now if i need to open it again and append other binary data how can i
proceed?


Regards

Luca
 
M

Marc 'BlackJack' Rintsch

if i have one file written in binary mode, how can i append others
binary data to this file after the its closure.
ex
my_file = open('blabal', 'wb')
then i write something and then
my_file.close()
now if i need to open it again and append other binary data how can i
proceed?

Just open it in append mode: ``open('blablal', 'ab')``

Ciao,
Marc 'BlackJack' Rintsch
 
R

Robert Rawlins - Think Blue

Do the same again, but change that 'wb' to 'a' for append :-D should sort
you out.

Rob

-----Original Message-----
From: python-list-bounces+robert.rawlins=thinkbluemedia.co.uk@python.org
[mailto:python-list-bounces+robert.rawlins=thinkbluemedia.co.uk@python.org]
On Behalf Of luca72
Sent: 16 April 2007 16:57
To: (e-mail address removed)
Subject: file resume

Hello at all:
if i have one file written in binary mode, how can i append others
binary data to this file after the its closure.
ex
my_file = open('blabal', 'wb')
then i write something and then
my_file.close()
now if i need to open it again and append other binary data how can i
proceed?


Regards

Luca
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,058
Latest member
QQXCharlot

Latest Threads

Top