i have basic python knowledge please let me know how to get started with jython please let me know where can i find good online books for jython, how to write some small programs and how to run them
A lot of my Python26 code runs on Jython just fine. Not the Tkinter code, since Jython uses the Java GUI toolkit instead.
Here is an example
a Jython example for getting input and output on a console
using the swing.JOptionPane for input and message
tested with jython2.5.2 by vegaseat
import javax.swing.JOptionPane as jop
print('- - - - - -\n')
s = 'How many sides should the die have?'
sides = int(jop.showInputDialog(None, s))
s = 'How many times should we roll the die?'
rolls = int(jop.showInputDialog(None, s))
rand = java.util.Random()
for current in range(rolls):
print('Roll %d --> %d' % ((current+1), rand.nextInt(sides)+1))
jop.showMessageDialog(None, 'Integer Entry Error!')
I have my Editra IDE configured to run Jython code. Another general IDE that works well is ConText.
The Netbeans IDE might work, but I haven't figured it out yet. If anyone does, let me know right here!