On Jul 27, 4:50 pm, Farshid Lashkari <[EMAIL PROTECTED]> wrote: > beginner wrote: > > I did and it did not seem to work. I ended up doing the following. > > Verbose, isn't it? > > If I do d=PyFloat_AsDouble(oDiscount); in the third "if", I get an > > error. Maybe I missed something obvious. > > That's strange. I just tried the following code: > > fprintf(stdout,"True = %lf\n",PyFloat_AsDouble(Py_True)); > fprintf(stdout,"False = %lf\n",PyFloat_AsDouble(Py_False)); > fprintf(stdout,"5 = %lf\n",PyFloat_AsDouble(PyInt_FromLong(5))); > > And it printed the following: > > True = 1.000000 > False = 0.000000 > 5 = 5.000000 > > What version of Python are you using?
I am using 2.5.1 and Windows XP. Thanks for your help. -- http://mail.python.org/mailman/listinfo/python-list