Start New Discussion within our Software Development Community
import random
import string
import time
    import tkinter as tk
    import Tkinter as tk

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()
t0 -= time.clock()
print('Sorted in %.2f s' % -t0)

t0 = time.clock()
root = tk.Tk()

scrollbar = tk.Scrollbar(root, orient=tk.VERTICAL)
names_list = tk.Listbox(root, yscrollcommand=scrollbar.set)
scrollbar.pack(side=tk.RIGHT, fill=tk.Y)

for name in names:
    names_list.insert('end', name)

names_list.pack(side=tk.LEFT, fill=tk.BOTH, expand=1)
t0 -= time.clock()
print('List prepared in %.2f s' % -t0)

256000 words generated in 6.64 s
Sorted in 0.58 s
List prepared in 3.49 s

Python 2.6.6:
256000 words generated in 4.40 s
Sorted in 0.54 s
List prepared in 2.93 s

Python 2.7.1:
256000 words generated in 4.02 s
Sorted in 0.43 s
List prepared in 3.26 s


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

The article starter has earned a lot of community kudos, and such articles offer a bounty for quality replies.