Here is experiment of how VM and Swing UI manage the sort test posted previously, instead of CPython and Tkinter. The timing is not so sweet, but at least no Java required!

K:\jython2.5.2>java -jar jython.jar swing_test.py
256000 words generated in 10.93 s
Sorted in 1.68 s
List prepared in 22.71 s

Edited 5 Years Ago by pyTony: n/a

import random
import string
import time

import java.lang as lang
import javax.swing as swing
import java.awt as awt

def exit(event):
    lang.System.exit(0)

t0 = time.clock()
word_max = 256000
names = [''.join(random.choice(string.ascii_uppercase)
                 for count in range(6))
         for word_count in range(word_max)]
t0 -= time.clock()
print('%i words generated in %.2f s' % (word_max, -t0))

t0 = time.clock()
names.sort()
t0 -= time.clock()
print('Sorted in %.2f s' % -t0)

t0 = time.clock()
win = swing.JFrame("Sort names", windowClosing=exit)
win.contentPane.layout = awt.FlowLayout()
namelist = awt.Choice()
for name in names:
    namelist.addItem(name)

win.add(namelist)
win.pack()
win.size=(200, 200)
win.show()
t0 -= time.clock()
print('List prepared in %.2f s' % -t0)

Specialties:
IT/Science/Contracts/Religious translation/interpreting FIN-ENG-FIN
Python programming

Speedier list by JList.

K:\jython2.5.2>java -jar jython.jar jlist_ex.py
256000 words generated in 9.84 s
Sorted in 1.48 s
Time taken for list: 1.37 s
import random
import string
import time

import javax.swing as swing
import java.awt as awt

class JListWindow(object):
  def __init__(self, title, data):
    t0 = time.clock()
    frame = swing.JFrame(title)
    frame.setLayout(awt.FlowLayout())
    frame.setDefaultCloseOperation(swing.WindowConstants.EXIT_ON_CLOSE)

    spane = swing.JScrollPane()
    spane.getViewport().setView(swing.JList(data))
    self.label = swing.JLabel('Time to build list')
    frame.add(self.label)
    frame.add(spane)
    frame.pack()
    frame.setVisible(True)

    t0 -= time.clock()
    self.label.text = 'Time taken for list: %.2f s' % -t0
    print(self.label.text)


if __name__ == '__main__':
    t0 = time.clock()
    word_max = 256000
    names = [''.join(random.choice(string.ascii_uppercase)
                     for count in range(6))
             for word_count in range(word_max)]
    t0 -= time.clock()
    print('%i words generated in %.2f s' % (word_max, -t0))

    t0 = time.clock()
    names.sort()
    t0 -= time.clock()
    print('Sorted in %.2f s' % -t0)

    JListWindow("Jython Sorted List", names)

Making object based on JFrame:

import random
import string
import time

import javax.swing as swing
import java.awt as awt


def random_words(word_max, length):
    return [''.join(random.choice(string.ascii_uppercase)
                     for count in range(length))
             for word_count in range(word_max)]

class WordWindow(swing.JFrame):
    def __init__(self, length=6,  word_max=256000):
        super(swing.JFrame, self).__init__()
        self.contentPane.layout = awt.FlowLayout(  )
        self.setDefaultCloseOperation(swing.WindowConstants.EXIT_ON_CLOSE)
        self.title = 'Testing Swing and Jython'
        self.label = swing.JLabel()
        self.add(self.label)
        self.pack()
        self.show()

        t0 = time.clock()
        self.names = random_words(word_max, length)
        t0 -= time.clock()
        self.label.text = '%i words generated in %.2f s. ' % (word_max, -t0)
        self.pack()

        t0 = time.clock()
        self.names.sort()
        t0 -= time.clock()
        self.label.text += ' Sorting %.2f s.   ' % -t0
        self.pack()

        t0 = time.clock()
        spane = swing.JScrollPane()
        spane.getViewport().setView(swing.JList(self.names))
        t0 -= time.clock()
        self.label.text += 'Build: %.2f s. ' % -t0

        self.add(spane)
        self.pack()

if __name__ == '__main__':
    my_swing = WordWindow()
    print(my_swing.label.text)
The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.