Re: detecting property modification

2007-12-21 Thread Mangabasi
On Dec 21, 4:46 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Mangabasi a écrit : > (snip) > > > > > When you say "The Body gets asked for the value of the attribute" that > > means that Body's __dict__ is being asked to provide a value >

Re: detecting property modification

2007-12-21 Thread Mangabasi
On Dec 21, 1:11 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 21 Dec 2007 09:49:51 -0800 (PST), Mangabasi <[EMAIL PROTECTED]> wrote: > > [snip] > > >Hi Jean-Paul, > > >Sorry, I should have spelled this out in my post but I did not.  For > &g

Re: detecting property modification

2007-12-21 Thread Mangabasi
On Dec 21, 12:40 pm, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote: > On Fri, 21 Dec 2007 09:26:36 -0800 (PST), Mangabasi <[EMAIL PROTECTED]> wrote: > >Howdy, > > >I think it is easier to explain my question with a short example: > > >class Body: > >

detecting property modification

2007-12-21 Thread Mangabasi
Howdy, I think it is easier to explain my question with a short example: class Body: def __init__(self, pos): self.__dict__['pos'] = pos def __setattr__(self, name, value): if name == 'pos': print 'pos changed to', value self.__dict__[name] = value >>

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 2:24 pm, Lyosha <[EMAIL PROTECTED]> wrote: > On May 23, 12:19 pm, Lyosha <[EMAIL PROTECTED]> wrote: > > > > > On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote: > > > > On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTE

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 2:19 pm, Lyosha <[EMAIL PROTECTED]> wrote: > On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote: > > > On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > > > > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMA

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > When I modified this to: > > > class Point(list): > > def __init__(self,x,y): > > sup

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > When I modified this to: > > > class Point(list): > > def __init__(self,x,y): > > sup

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > There must be a way to inherit from the list type without having to > > redefine all the methods and attributes that regu

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > There must be a way to inherit from the list type without having to > > redefine all the methods and attributes that regu

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > There must be a way to inherit from the list type without having to > > redefine all the methods and attributes that regu

Re: Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote: > On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote: > > > There must be a way to inherit from the list type without having to > > redefine all the methods and attributes that regu

Inheriting from Python list object(type?)

2007-05-23 Thread Mangabasi
Howdy, I would like to create a Point class that lets me use Point instances like the following example. >>> p = Point(3, 4) >>> p.x 3 >>> p.y 4 >>> p.z 1 >>> p[0] 3 >>> p[1] 4 >>> p[1] = 5 >>> p.y 5 >>> other than the x, y, z attributes, these instances should behave like regular Python lists.

Establishing socket connections to Synthesis Toolkit

2007-04-23 Thread Mangabasi
commands to this connection once it is established? Thank you in advance, Mangabasi # Tcl/Tk Drum GUI for the Synthesis Toolkit (STK) # Set initial control values set press 127 set outID "stdout" set commtype "stdout" # Turn down the reverb puts $outID "ControlCh

Re: Calling Fortran from Python

2007-04-05 Thread Mangabasi
On Apr 4, 10:10 pm, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > On Apr 4, 5:48 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Mangabasi wrote: > >>> Would Python 2.5 work with Visual Studio 6.6? > >> No. > > >&

Re: Calling Fortran from Python

2007-04-05 Thread Mangabasi
On Apr 4, 10:10 pm, Lenard Lindstrom <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > On Apr 4, 5:48 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Mangabasi wrote: > >>> Would Python 2.5 work with Visual Studio 6.6? > >> No. > > >&

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
On Apr 4, 5:48 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > Would Python 2.5 work with Visual Studio 6.6? > > No. > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless enigma > that is made

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
On Apr 4, 4:39 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > I am using Visual Studio 6.0 and Compaq Visual Fortran 6.6. > > Ah. You can't use VS6 with that version of Python. I believe you need the .NET > SDK 2003. > > You could also use gcc,

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
On Apr 4, 12:22 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Mangabasi wrote: > > Robert, > > > Thanks for your prompt response. I think I got a lot closer but no > > cigar yet. > > > This is the output > > > C:\fortrandll>f2py -c -m sampl

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
There may be a way to finish this without having to deal with distutils. F2py created three files so far samplemodule.c fortranobject.h fortranobject.c Is there a way to create the sample.pyd from these files? -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling Fortran from Python

2007-04-04 Thread Mangabasi
Robert, Thanks for your prompt response. I think I got a lot closer but no cigar yet. This is the output C:\fortrandll>f2py -c -m sample sample.pyf sample.for numpy_info: FOUND: define_macros = [('NUMERIC_VERSION', '"\\"24.2\\""')] include_dirs = ['C:\\Python24\\include'] running bui

Calling Fortran from Python

2007-04-03 Thread Mangabasi
Howdy, I have been trying to call the following Fortran function from Python (using Windows XP, Compaq Fortran and Python 2.4). I tried F2Py, Pyfort and calldll with no success. I think I came very close with calldll. Here is a short summary Fortran code: SUBROUTINE SAMPLE(IERR1,IERR2,A

Python to C++ translation?

2005-07-18 Thread Mangabasi
Hi there, I need to translate the following code (rather something similar) to C++. I have been studying C++ for the last two days but I could not find an easy way to do the following Python snippet. class A: def __init__(self, x): self.x = x def methodA(): pass # Ignore