Page 1 of 1

Exec commands from python

Posted: 19.04.2021 22:58
by alexandresgv
I would like to execute and terminate python functions like a concurrent process from a python script

There is a python command like pascal uo.exec('exec test()')

Code: Select all

def test2():
    while True:
        AddToSystemJournal("Test 2")
        Wait(2000)

def test1():
    while True:
        AddToSystemJournal("Test 1")
        Wait(2000)

def main():
    Exec("test1") # something like this function
    Exec("test2") # something like this function
    Terminate("test1")
    Terminate("test2")

if __name__ == '__main__':
    main()