def on_start_clicked(self, w=None): print "start your engines" self.clear_text() self.statusbar.push(self.statusbar_context_id, "Creating...") quantity=self.password_quantity.get_value_as_int() length=self.password_length.get_value_as_int() key_type = self.key_type.get_active() time_a=time.time() # display 200 passwords at a time if quantity>200: q2=quantity/200 q2=quantity/q2 else: q2=quantity print q2 password_out="" count=0 while count<quantity: password_list = password_rand.randword(q2, length, key_type) for x in password_list: self.password_buffer.insert(self.password_buffer.get_end_iter(), x+"\n") while gtk.events_pending(): gtk.main_iteration() count += q2 time_b=time.time() print "Time elapsed: ", time_b - time_a self.statusbar.push(self.statusbar_context_id, "Finished...")