Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,14 @@ loop = asyncio.get_running_loop()
|
|
5 |
from requests_html import AsyncHTMLSession
|
6 |
asession = AsyncHTMLSession(loop=loop)
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
# https://huggingface.co/blog/streamlit-spaces
|
9 |
langtext = st.text_input("language lookup using https://github.com/rspeer/langcodes, see also https://r12a.github.io/app-subtags/", "english")
|
10 |
|
@@ -38,10 +46,7 @@ if lang is None:
|
|
38 |
lang = None
|
39 |
|
40 |
|
41 |
-
|
42 |
-
r = await asession.get(r12_url)
|
43 |
-
r.html.arender()
|
44 |
-
st.write(r.html.search("language codes"))
|
45 |
|
46 |
#st.write(f"langcodes found the following tag: {type(found)}") # a Language object
|
47 |
if lang is not None:
|
|
|
5 |
from requests_html import AsyncHTMLSession
|
6 |
asession = AsyncHTMLSession(loop=loop)
|
7 |
|
8 |
+
async def get_pythonorg():
|
9 |
+
r = await asession.get('https://python.org/')
|
10 |
+
return r
|
11 |
+
|
12 |
+
|
13 |
+
results = asession.run(get_pythonorg)
|
14 |
+
st.write(results)
|
15 |
+
|
16 |
# https://huggingface.co/blog/streamlit-spaces
|
17 |
langtext = st.text_input("language lookup using https://github.com/rspeer/langcodes, see also https://r12a.github.io/app-subtags/", "english")
|
18 |
|
|
|
46 |
lang = None
|
47 |
|
48 |
|
49 |
+
|
|
|
|
|
|
|
50 |
|
51 |
#st.write(f"langcodes found the following tag: {type(found)}") # a Language object
|
52 |
if lang is not None:
|