Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
import langcodes
|
| 3 |
import asyncio
|
|
|
|
|
|
|
| 4 |
#loop = asyncio.get_running_loop()
|
| 5 |
loop = asyncio.new_event_loop()
|
| 6 |
asyncio.set_event_loop(loop)
|
|
@@ -9,8 +11,9 @@ asyncio.set_event_loop(loop)
|
|
| 9 |
from requests_html import AsyncHTMLSession
|
| 10 |
asession = AsyncHTMLSession()
|
| 11 |
|
| 12 |
-
async def
|
| 13 |
-
r = await asession.get(
|
|
|
|
| 14 |
return r
|
| 15 |
|
| 16 |
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
import langcodes
|
| 3 |
import asyncio
|
| 4 |
+
|
| 5 |
+
# see https://github.com/streamlit/streamlit/issues/744#issuecomment-686712930
|
| 6 |
#loop = asyncio.get_running_loop()
|
| 7 |
loop = asyncio.new_event_loop()
|
| 8 |
asyncio.set_event_loop(loop)
|
|
|
|
| 11 |
from requests_html import AsyncHTMLSession
|
| 12 |
asession = AsyncHTMLSession()
|
| 13 |
|
| 14 |
+
async def get_r12(langtext):
|
| 15 |
+
r = await asession.get(f"https://r12a.github.io/app-subtags/?find={langtext}")
|
| 16 |
+
await r.html.arender()
|
| 17 |
return r
|
| 18 |
|
| 19 |
|