Re: AW: Write to a binary file

2007-04-05 Thread Grant Edwards
On 2007-04-05, Thinker <[EMAIL PROTECTED]> wrote: >>> --- START --- >>> import os >>> >>> msg = chr(0x02) + chr(0x36) + chr(0x00) + chr(0x01) + chr(0x0a) + >>> chr(0xb0) + chr(0x77) >>> >>> f = os.open('/dev/pytest', os.O_RDWR) >>> os.write(f,msg) >>> os.close(f) >>> >>> f = file('/dev/pytest', 'w

Re: AW: Write to a binary file

2007-04-05 Thread Gabriel Genellina
En Thu, 05 Apr 2007 11:38:06 -0300, Grant Edwards <[EMAIL PROTECTED]> escribió: > On 2007-04-05, Thomi Aurel RUAG A <[EMAIL PROTECTED]> wrote: > >> The output was: >> --- Start --- >> Pytest write> 02 36 00 01 0a b0 77 >> Pytest write> 02 36 00 01 0a >> Pytest write> b0 77 >> --- END --- > > I'm

Re: AW: Write to a binary file

2007-04-05 Thread Thinker
Grant Edwards wrote: > On 2007-04-05, Thomi Aurel RUAG A <[EMAIL PROTECTED]> wrote: > > >> A simplified test programm to compare the function for opening >> a file i used ("file()") and your suggested "os.open()" showed >> different behaviour. >> >> My simple testprogramm: >> >> --- START --- >>

Re: AW: Write to a binary file

2007-04-05 Thread Grant Edwards
On 2007-04-05, Thomi Aurel RUAG A <[EMAIL PROTECTED]> wrote: > A simplified test programm to compare the function for opening > a file i used ("file()") and your suggested "os.open()" showed > different behaviour. > > My simple testprogramm: > > --- START --- > import os > > msg = chr(0x02) + chr(