Execute commands from file

2007-05-16 Thread tmp123
Hello, Thanks for your time. We have very big files with python commands (more or less, 50 commands each file). It is possible to execute them command by command, like if the commands was typed one after the other in a interactive session? ( Better using command flags than with an small scr

Re: newbie: copy base class fields

2007-05-06 Thread tmp123
On May 3, 4:57 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > Is it okay to copy them all at once? Like this: > > class B(A): > def __init__(self, a): > self.__dict__.update(a.__dict__) > self.v2 = 2 > Thanks a lot for the answers, they seem to agree with the requested funcitio

Re: newbie: copy base class fields

2007-05-03 Thread tmp123
On May 3, 4:29 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > #!/usr/bin/python > > # > > > class A: > > def __init__(self): > > self.v1=1 > > > def __repr__(self): > > return "v1=%d\n" % self.v1 > > > class B(A): > > def __init__(self,a): > > self=a > > self.v

newbie: copy base class fields

2007-05-03 Thread tmp123
Hello, Thanks for your time. The following small program gives an error: #!/usr/bin/python # class A: def __init__(self): self.v1=1 def __repr__(self): return "v1=%d\n" % self.v1 class B(A): def __init__(self,a): self=a self.v2=2 def __repr__(self): return A.__r

Re: pack/unpack zero terminated string

2007-05-03 Thread tmp123
On May 2, 11:13 pm, John Machin <[EMAIL PROTECTED]> wrote: > On May 3, 12:01 am, Laurent Pointal <[EMAIL PROTECTED]> wrote: > > > > > > > > >tmp123a écrit : > > > > Hello, > > > > Thanks for your time. > > > > After review the "struct" documentation, it seems there are no option > > > to pack/unpac

pack/unpack zero terminated string

2007-05-02 Thread tmp123
Hello, Thanks for your time. After review the "struct" documentation, it seems there are no option to pack/unpack zero terminated strings. By example, if the packed data contains: byte + zero terminated string + zero terminated string + byte, it seems no possible to unpack it using "struct". Pl