from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.keys import Keys import time,os,sys import pickle from random import randrange import subprocess from datetime import datetime,timedelta import requests import gradio as gr def greet(name): return "Hello " + name + "!!" if __name__ == "__main__": with open("test.log", "wb") as f: process = subprocess.Popen(['python','/home/user/app/main.py'], stdout=subprocess.PIPE) for c in iter(lambda: process.stdout.read(1), b""): sys.stdout.buffer.write(c) try: f.buffer.write(c) except: continue #result = subprocess.run(["python", 'main.py'], capture_output=True, text=True) demo = gr.Interface(fn=greet, inputs="text", outputs="text") demo.launch(server_name="0.0.0.0", server_port=7860) print('starting')