python 2.7 - Why does this runs twice? -


i made program runs using systrayicon

and thou works fine, every time checks something, twice. can fix reducing chance half, that's shortcut not proper fix.

from systray import systrayicon random import randint   def shutprogram(systrayicon):     = getsomething()     while true:         if getsomething() != :             = getsomething()             if randint(0,100) <= 10:                 print "stop, hammer time!"                 stopthis()             else:                 print "you may pass"  menu = (('start', icon.next(), shutprogram),)  systrayicon(icon.next(),"shut program",menu) 

oh, got. when tried 'getsomething', had wait bit because had delay prompted returning string 'wait, getting info'.


Comments

Popular posts from this blog

How to access named pipes using JavaScript in Firefox add-on? -

multithreading - OPAL (Open Phone Abstraction Library) Transport not terminated when reattaching thread? -

node.js - req param returns an empty array -