python - Permutations and combinations error in kivy -


i have developed script shows combinations of given word

main.py (without imports have done )

class combinations(popup): def present(self):     import itertools     import sys     a=str(self.word.text)     count=0     if len(a)>=6:         os.startfile("e:\\python27\\my programs\\novos\\beta\\combinations.py")     else:         h in itertools.permutations(a):             count=count+1             x=count, ''.join(h)             x=str(x)             x="\n"+x             self.sh.text+=(str(x))     self.sh.text+=(str("\nthere {0} combinations of {1}".format(count,a))) 

and corresponding .kv file

<combinations>: size_hint: .5, .9 title:"permutations , combinations" word:wo sh:sh boxlayout:     orientation:"vertical"     textinput:         id:wo         text:""         font_name:"roboto-light.ttf"         font_size:30     button:         text:"done"         on_press:root.present()     textinput:         id:sh         text:""         multiline:true         readonly:true     button:         text:"close"         on_press:root.dismiss() 

everything works fine when word 5 letters long, otherwise kivy interface hangs , have forcefully close it.

could answer this?


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -