]7ec@sLddlTddlZdddYZdZedkrHendS(i(t*Nt ElectronscBs&eZddZdZdZRS(c Cs||_t|_}t||_}|j|j|d|j|d}}|r|j|d|dd|dd|_ng|_ d \}}} } xWt |D]I} |j ||| | d d } |j j | |d| d}} qW|jj dS(Ntwidththeightitbitmapt foregroundtbluei iFiiJtfilltred(i iFiiJ(tntTkttktCanvastcanvastpacktgetintt create_bitmapRtpiecestranget create_ovaltappendtupdate( tselfR RR tcRRtx1ty1tx2ty2titp((s4/usr/lib64/python2.7/Demo/tkinter/guido/electrons.pyt__init__s   ' cCsq|j}xT|jD]I}tjtdd}tjtdd}|j|||qW|jjdS(Niii(R RtrandomtchoiceRtmoveR R(RR RRtxty((s4/usr/lib64/python2.7/Demo/tkinter/guido/electrons.pyt random_move+s  cCshy+x$tdD]}|j|jqWWn6tk rcy|jjWqdtk r_qdXnXdS(Ni(RR$R tTclErrorR tdestroy(RR((s4/usr/lib64/python2.7/Demo/tkinter/guido/electrons.pytrun4s  N(t__name__t __module__tNoneRR$R'(((s4/usr/lib64/python2.7/Demo/tkinter/guido/electrons.pyRs  cCsddl}ddl}|jdr>|j|jd}nd}|jdr|jd}|ddkr{|d}qd|}nd}t||}|jdS(Niiiiit@(tsyststringtargvtatoiR*RR'(R,R-R Rth((s4/usr/lib64/python2.7/Demo/tkinter/guido/electrons.pytmain@s     t__main__((tTkinterRRR1R((((s4/usr/lib64/python2.7/Demo/tkinter/guido/electrons.pyts  -