Stopping the execution of a script from another script

If you have a question or need help, this is the place to be.

Stopping the execution of a script from another script

Postby krambriw » Wed Aug 22, 2007 4:13 pm

Hello,

I try to stop a running script from another script but no success.

Start the first script and when it is running/sleeping, start the second script.

Sample below
Best regards, Walter

First script

Code: Select all
eg.globals.StopTheScript = False

ind = 1
while ind < 5:
    if eg.globals.StopTheScript == True:
        eg.Exit()
    remain = int(time.strftime("%S", time.localtime()))
    if remain > 30:
        remain = remain - 30
    print 30-remain
    time.sleep(30-remain)
    ind += 1




The second script

Code: Select all
eg.globals.StopTheScript = True
eg.Exit()
krambriw
Plugin Developer
 
Posts: 1144
Joined: Sat Jun 30, 2007 2:51 pm

Re: Stopping the execution of a script from another script

Postby Bartman » Wed Aug 22, 2007 5:19 pm

The macros and therefore the two scripts will not run simultaneously. EG will run each macro after an other.
You have to use threads to run multiple scripts in time shared way.
Bartman
Plugin Developer
 
Posts: 881
Joined: Sun Feb 12, 2006 9:03 am


Return to General Support

Who is online

Users browsing this forum: No registered users and 5 guests