From: Luca C. <cas...@li...> - 2007-01-27 18:45:05
|
>>>>> import javax.power.monitor.PowerMonitor >>>>> pm = javax.power.monitor.PowerMonitor.getInstance() >>>>> print pm.getBatteryLevel() It's a pity my javaphone implementation is "wrong" (???) , as it always returns same value for getBatteryLevel ( 0x7FFFFFFF ), but at least now I know how to properly access Javaphone methods... *********** REPLY SEPARATOR *********** On 27/01/2007 at 13.33 James R Eagan wrote: >On Jan 27, 2007, at 13:16 , Luca Cassioli wrote: > >> >>>>> import javax.power.monitor.PowerMonitor >>>>> pm = javax.power.monitor.PowerMonitor >>>>> print pm.getBatteryLevel() >> TypeError: >> getBatteryLevel(): >> expected 1 arg; not 0 > >pm is the PowerMonitor class, not an instance. You want: > >pm = javax.power.monitor.PowerMonitor() > ^^ > >I'd suggest you take a look at the Python tutorial for Python 2.1: >http://python.org/doc/2.1/tut/tut.html > >If you're already familiar with programming, its a quick and easy way >to get up to speed with Python. > >Cheers! >James > >-- >Against stupidity the very Gods themselves contend in vain. |