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?

BTW, I think that in example code it's a Good Idea to follow PEP8...
-- 
Aahz (a...@pythoncraft.com)           <*>         http://www.pythoncraft.com/

"If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur."  --Red Adair
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to