Re: [Tutor] reading output from a c executable.

2008-12-20 Thread Alan Gauld
"Bill Campbell" wrote struct nameid { u32bits len /* total length */ u32bits id; char name; /* name variable length */ } I haven't done this in python yet, but when handling things like this in C and perl, I have done it with two reads, the first to get the length, the second to read

Re: [Tutor] Compiling Python 2.6.1 on Leopard

2008-12-20 Thread Alan Gauld
"R. Ellsworth Pollard" wrote in message news:d52d80370812201240te2d4abby16a7b7745768b...@mail.gmail.com... Where might I find instructions for compiling Python on Leopard? Have you tried the Mac mailing list or the MacPython web site? I expect the procedure to be the same as for previous ve

Re: [Tutor] reading output from a c executable.

2008-12-20 Thread Alan Gauld
"Ravi Kondamuru" wrote struct nameid { u32bits len /* total length */ u32bits id; char name; /* name variable length */ } As can be seen the length of the name = len - (sizeof(len) + sizeof(id)). How do I use xstruct or struct to unpack such a structure? I think you will need to r

[Tutor] Compiling Python 2.6.1 on Leopard

2008-12-20 Thread R. Ellsworth Pollard
Where might I find instructions for compiling Python on Leopard? Robert ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] reading output from a c executable.

2008-12-20 Thread Bill Campbell
On Sat, Dec 20, 2008, Ravi Kondamuru wrote: >I am trying to use xstruct module to unpack a varaible size record with the >following structure. > >struct nameid { >u32bits len /* total length */ >u32bits id; >char name; /* name variable length */ >} > >As can be seen the length of the name =

Re: [Tutor] reading output from a c executable.

2008-12-20 Thread Ravi Kondamuru
I am trying to use xstruct module to unpack a varaible size record with the following structure. struct nameid { u32bits len /* total length */ u32bits id; char name; /* name variable length */ } As can be seen the length of the name = len - (sizeof(len) + sizeof(id)). How do I use xstr

Re: [Tutor] MP3Info class usage

2008-12-20 Thread Todd Zullinger
Terry Carroll wrote: > On Fri, 19 Dec 2008, Terry Carroll wrote: >> It would be nice if Eyed3, which is not OS-specific, did not have >> such an OS-specific install process. Perhaps. But someone who cares about windows support would have to submit patches. I don't know if Travis uses windows or

Re: [Tutor] Class Extend Help

2008-12-20 Thread Martin Walsh
Omer wrote: > Hey. > > I'm trying to do something I think is basic and am failing. > > The goal is: > [mimicking the google urlopen syntax] > > try: > from google.appengine.api.urlfetch import fetch > except: > from urllib import urlopen as fetch > > > How do I add this "fetch" the

Re: [Tutor] Class Extend Help

2008-12-20 Thread Richard Lovely
There are three ways as I see it: using __getattr__, using a new init, or using a property decorator. The last two are probably the most pythonic, but I'm not familiar with decorators, so here's how I'd do the second of the three: try: from google.appengine.api.urlfetch import fetch except:

[Tutor] Class Extend Help

2008-12-20 Thread Omer
Hey. I'm trying to do something I think is basic and am failing. The goal is: [mimicking the google urlopen syntax] try: from google.appengine.api.urlfetch import fetch except: from urllib import urlopen as fetch How do I add this "fetch" the property of content? I basically want fetc