How to run mp_embed_exec_str in nonblocking state. #13008
Replies: 3 comments 6 replies
-
@nikhil-robinson I'm not quite sure what you're asking for -- what do you mean by "how to exit out"? Also why are you using the embedded example in conjunction with the esp32 port? |
Beta Was this translation helpful? Give feedback.
-
Hi @jimmo lets say i wrote a program for printing hi in a while loop
if i run this program using the mp_embed_exec_str function there is no way to stop the program and the mp_embed_exec_str function blocks the entire code flow . i want to exit out of the while loop after some time period , i am not using the entire example i am just using the mp_embed_exec_str function from the embedded example . i wanted run python code inside of my application without repl so i took the function mp_embed_exec_str from the embed example and port it to esp32 everything works but if there is a while loop i am unable to exit out of the execution |
Beta Was this translation helpful? Give feedback.
-
@nikhil-robinson: If you allow to execute arbitrary python code written by the user, you could
However, arbitrary code gives the user a gazillion other ways (besides long-running loops) to brick the device you are building. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there i was testing the embedded example and the mp_embed_exec_str is blocking if i add an infinite while loop. how to exit out without destining the mpy. i am using esp32 port.
Beta Was this translation helpful? Give feedback.
All reactions