cdleong commited on
Commit
6390590
·
1 Parent(s): a161e2d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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 get_pythonorg():
13
- r = await asession.get('https://python.org/')
 
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