[wxPython] interruption of a programme...

Hello,

I have programmed a graphical interface with two buttons 'run' and
'stop'.
With the button 'run ', I launch a little programme (first script) and
with the button 'stop', I would like to interrup this programme . But
when the programme is running, I can't use the button 'stop'.
Is there a function to do this or another method??
thanks for your help
Graziella

···

#-----------------------------
first script : first.py
-------------------
def test(stop):
    for i in range(0,1000):
        print 'bla bla'
        if stop == 1:
            break
--------------------

#------------------------
second script: second.py
--------------------
import first
...
EVT_BUTTON(self, ID_BUTTON_RUN, self.run)
EVT_BUTTON(self, ID_BUTTON_STOP, self.stop)

def run(self, event):
        print 'start the programme'
        stop = 0
        first.test(stop)

def stop(self, event):
        print 'stop the programme'
        stop = 1
        first.test(stop)

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users

Run the little program in a separate thread. See Pythons Thread library
(fairly easy to learn).

- Josef

···

----- Original Message -----
From: "graziella Lesiour" <Graziella.Lesiour@bmw.de>
To: "Python" <wxpython-users@lists.sourceforge.net>
Sent: Monday, January 22, 2001 2:17 PM
Subject: [wxPython] interruption of a programme...

Hello,

I have programmed a graphical interface with two buttons 'run' and
'stop'.
With the button 'run ', I launch a little programme (first script) and
with the button 'stop', I would like to interrup this programme . But
when the programme is running, I can't use the button 'stop'.
Is there a function to do this or another method??
thanks for your help

_______________________________________________
wxPython-users mailing list
wxPython-users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/wxpython-users