I would like set a limit time for process in python, because this process doesn't end with itself. It is something like this:
def forever():
pass
somethink_to_do_this_20_secounds:
forever()
print("this print after 20 seconds of forever() work")
I found a topic about checking program execution time, but I did not find setting the time limit for the program How do I get time of a Python program's execution?
How i can realize this somethink_to_do_this_20_secounds in Python? By using subprocess?