import subprocess
import time

p = subprocess.Popen(["npx", "-y", "localtunnel", "--port", "8001"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
time.sleep(5)
p.poll()
import fcntl, os
fcntl.fcntl(p.stdout, fcntl.F_SETFL, os.O_NONBLOCK)
try:
    print(p.stdout.read())
except:
    pass
