idea: Robocode for Python

C. Porter Bassett porter at et.byu.edu
Wed Sep 12 23:56:49 EDT 2001


> > 
> > warning: jfindattr(org.python.core.PyProxy,java.lang.String) in
> > org.python.core.Py has been deprecated
> >         PyObject inst = Py.jfindattr(this, "onScannedRobot");
> >                           ^
> > .\jpywork\pyrobot.java:110: warning:
> > jfindattr(org.python.core.PyProxy,java.lang.String) in
> > org.python.core.Py has been deprecated
> >         PyObject inst = Py.jfindattr(this, "run");
> > 
> 
> Deprecated methods should not be used for new designs as these might 
> disapear in a future version of Java. On the other hand this means that 
> these methods are there and perfectly working, its only a warning.

OK, how am I using depreciated methods?  I wasn't doing anything
special - just defining a class with two methods.  Here's my code
again:

from robocode import *
class pyrobot(Robot):
   def run(self):
      while(1):
         self.ahead(100)
         self.turnGunRight(360)
         self.back(100)
         self.turnGunRight(360)
   def onScannedRobot(self, event):
      self.fire(1)



More information about the Python-list mailing list