newbie: concatenate literals (using jython)

davidmichaelkarr at gmail.com davidmichaelkarr at gmail.com
Thu Dec 22 13:14:39 EST 2005


I'm using Jython (actually WebLogic WLST), and trying to do something
really simple.  I want to create a string from two function calls and a
literal, like:

  serverport = server.getListenAddress() + ':' + server.getListenPort()

This complains:

TypeError: __add__ nor __radd__ defined for these operands

I've looked at various references, and this seems like the way I'm
supposed to do this, but I'm obviously missing something.  Note that
"getListenPort()" returns an int.  Is that a problem?




More information about the Python-list mailing list