Aahz wrote:
> On Tue, Jan 12, 2010, Tim Roberts wrote:
>   
>> I would pass the struct as a string of 14 bytes, then use
>>     emp_name, emp_ID = struct.unpack( '=10cI', incoming )
>>
>> class employee:
>>     def __init__( self, name, id ):
>>         self.name = name
>>         self.id = id
>>     def to_file( self, f ):
>>         f.write( struct,pack( '=10cI', self.name, self.id )
>>     def from_string( self, s ):
>>         self.name, self.id = struct.unpack( '=10cI', s )
>>     
>
> Why are you using the asymmetric "to_file" and "from_string" methods?
> Just for examples?
>   

Yes.  That nagged me when I wrote it, and I decided to leave it as an
exercise for the reader...

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to