Re: [Python] Come scrivere un array di bytes in un file binario

2007-10-01 Per discussione Francesco Guerrieri
On 10/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > soluzione trovata: > > file = open(fileName, 'wb') > for entry in bytes: > file.write(struct.pack('b', entry)) > file.close() > ottimo :-) Cerca di cambiare il nome 'file' in qualcosa tipo my_file, altrimenti oscuri il

RE: [Python] Come scrivere un array di bytes in un file binario

2007-10-01 Per discussione Patrizio.Ferlito
/resource/DummyEvent-Consumer1-ConsumerEventTransf.Xquery ... ciao ferp -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francesco Guerrieri Sent: lunedì, 1. ottobre 2007 15:31 To: Discussioni generali sul linguaggio Python Subject: Re: [Python] Come scrive

Re: [Python] Come scrivere un array di bytes in un file binario

2007-10-01 Per discussione Francesco Guerrieri
On 10/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > provato ma: > > cat my.jar > array([80, 75, 3, 4, 20, 0, 8, 0, 8, 0, -111, 121, 65, 55, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 10, 0, , 0, 0, 0], byte) Questo vuol dire che str(bytes) ha quella rappresentazione. Cosa ti aspettavi inve

RE: [Python] Come scrivere un array di bytes in un file binario

2007-10-01 Per discussione Patrizio.Ferlito
Guerrieri Sent: lunedì, 1. ottobre 2007 15:08 To: Discussioni generali sul linguaggio Python Subject: Re: [Python] Come scrivere un array di bytes in un file binario On 10/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Ma ricevevo il seguente errore: > > [java] Proble

Re: [Python] Come scrivere un array di bytes in un file binario

2007-10-01 Per discussione Francesco Guerrieri
On 10/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Ma ricevevo il seguente errore: > > [java] Problem invoking WLST - Traceback (innermost last): > [java] File "/products/.../export.py", line 107, in ? > [java] File "/products/.../export.py", line 79, in export > [ja

RE: [Python] Come scrivere un array di bytes in un file binario

2007-10-01 Per discussione Patrizio.Ferlito
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Francesco Guerrieri Sent: lunedì, 1. ottobre 2007 14:44 To: Discussioni generali sul linguaggio Python Subject: Re: [Python] Come scrivere un array di bytes in un file binario On 10/1/07, [EMAIL PROTEC

Re: [Python] Come scrivere un array di bytes in un file binario

2007-10-01 Per discussione Francesco Guerrieri
On 10/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Ciao a tutti, > > non uso direttamente python ma lo uso indirettamente da WLST (weblogic > scripting tool). > > Ho un array di bytes da scrivere in un file binario, il codice è il > seguente: > > fileName = 'my.jar' > bytes = ... > file

[Python] Come scrivere un array di bytes in un file binario

2007-10-01 Per discussione Patrizio.Ferlito
Ciao a tutti, non uso direttamente python ma lo uso indirettamente da WLST (weblogic scripting tool). Ho un array di bytes da scrivere in un file binario, il codice è il seguente: fileName = 'my.jar' bytes = ... file = open(fileName, 'wb') file.write(String(bytes)) file.close() ma se facci