cos: "Integer Required"?!?!?!?
iant at the-wire.com
Wed Jun 14 17:20:06 CEST 2006
It appears that the cause of this problem was indirect.
I input something incorrect as an argument to an xplane sdk function
and the cos/integer type error followed.
Thanks for the help. The diagnostic functions I learned in this thread
will be very helpful in the future.
> I'm using ActiveState PythonV2.4.1
> I'm certainly not affecting 'math'. I wonder if the XPlane SDK Python
> binding is touching anything.
> I'll download the latest ActiveState Python and keep on plugging.
> Mikael Olofsson wrote:
> > moonman wrote:
> > > print self.ACphi, type(self.ACphi) yields:
> > > 19412557 <type 'int'>
> > >
> > > value = XPLMGetDataf(self.ACphi); print value type(value ) yields:
> > > -0.674469709396 <type 'float'>
> > >
> > > print math.radians(XPLMGetDataf(self.ACphi)),
> > > type(math.radians(XPLMGetDataf(self.ACphi))) yields:
> > >
> > > TypeError
> > > :
> > > an integer is required
> > >
> > > Am I totally missing something about 'math'. Does it really expect an
> > > int?
> > Not my Python:
> > >>> math.radians(-0.674469709396)
> > -0.011771717133929535
> > This all seems very confusing. Have you tried exactly the above?
> > Do you perhaps have a module of your own called math, that Python might
> > be importing? Or is your math not a module, but some other object that
> > happens to have a method called radians, that expects an int? Or have
> > you accidentally redefined math.radians?
> > /MiO
More information about the Python-list