File size: 1,221 Bytes
0f4feb8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3e3a942
 
 
 
 
 
 
 
 
0f4feb8
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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')