[Python] python API wait for .cmm script to finish

Discussão em 'Python' iniciado por Stack, Março 19, 2025.

  1. Stack

    Stack Membro Participativo

    I am using python with the lauterbach.trace32.rcl library to control a trace32 instance. My goal is to call a .cmm script and wait for the script to complete.

    My current python script looks like this (simplified):

    instance.cmm("testScript.cmm")
    instance.cmd("SYStem.Mode Go")


    This causes problems because the second command is being executed while the testScript.cmm is still running.

    I noticed that putting a simple time.sleep(1) between the two lines would resolve the issue, but I don't like the solution because in some cases the script may need more time to complete the execution:

    instance.cmm("testScript.cmm")
    time.sleep(1) # wait for 1 second
    instance.cmd("SYStem.Mode Go")


    Is there a more intelligent solution?

    Thank you for helping out <3

    Continue reading...

Compartilhe esta Página