L
L
leham12020-04-23 23:07:01
Python
leham1, 2020-04-23 23:07:01

How to make the parent script continue to work in python even if the child script gives an error?

Hello.
I need to store many other scripts in one script. And when I run this parent script, so that the scripts in it are run one by one. For now, all I have in mind is running child scripts via import. But the question is: How can I make sure that if an error occurs in a child script, this child script closes and others continue to work. In short, so that it does not stop the whole process.

Please help someone with good advice)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Pankov, 2020-04-23
@leham1

Import and run code in a try-except block.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question