There is a Python script which calls a library selenium
, which calls on a server binary chromedriver
, then hangs and waits for connections. It looks like:
... connect selenium ...
# Hang
while True:
pass
The script can not exit since if it does, chromedriver
also exits, while certain other programs need it.
It works fine, except that much CPU time is spent, constant 25% on my machine (Ubuntu). Therefore it seems that while True: pass
is unacceptable. What's the proper approach for this?