close a window and continue execution in the other one?????

Post here if you need help with creating a Graphical User Interface in Python.

close a window and continue execution in the other one?????

Postby MaRie » Wed Nov 20, 2013 3:10 pm

I'm really lost...I open a window with two buttons, and when you click on the button called "REGISTER SOME KEY PRESSES" it runs the script called registerSomeKeyPresses.py, BUUUUT once finished I want to close that execution but keep the first window displaying...it's being impossible for me....

Please, i would reaaaally appreciate any help... :roll:

Thanks!
Code: Select all

#!/usr/bin/env python
from Tkinter import *
import threading

v0 = Tk()

def finishApplication(): v0.destroy()
def registerSomeKeyPresses():
    t = threading.Thread(target=execfile("registerSomeKeyPresses.py"))

    t.start()

def waitAndRun(f): v0.after(200, f)

b1=Button(v0,text="TERMINAR APLICACION",command=lambda: finishApplication()).pack()

button_keyPresses=Button(v0,text="REGISTER SOME KEY PRESSES",command=lambda: waitAndRun(registerSomeKeyPresses())).pack()

v0.mainloop()



================ registerSomeKeyPresses.py ===========================
Code: Select all

Do several things and last command:

io.quit()

Last edited by stranac on Wed Nov 20, 2013 3:50 pm, edited 1 time in total.
Reason: First post lock.
MaRie
 
Posts: 1
Joined: Wed Nov 20, 2013 2:29 pm

Return to GUI

Who is online

Users browsing this forum: No registered users and 1 guest

cron