I just found out that the controller has a setScript() function. Try this if bored.
cont = GameLogic.getCurrentController() print dir(cont) cont.setScript("print 'hi'")
If you use an always sensor that only fires once. It will print the dir of the controller. If it fires a second time with an f delay or something so you don’t get a million of them, the next time it will print “hi”. Don’t know quite how it would be useful.