A: 

i found it ^_^ . the (connect) function should be called in the mainloop

Moayyad Yaghi