Archan commited on
Commit
3815fb2
1 Parent(s): 5409b09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -12
app.py CHANGED
@@ -38,25 +38,26 @@ paper=""
38
  if submit_paper:
39
  paper = get_paper(pname)
40
 
 
41
  if paper:
42
  name = paper.title+'.pdf'
43
  name = name.replace('?', '')
44
  name = "downloads/" + name
45
 
46
- tpages = len(list(extract_pages(name)))
47
- print("total pages=", tpages)
48
- pgs = [i+1 for i in range(tpages)]
49
 
50
- start_page = 1
51
- end_page = 1
52
 
53
- with st.form(key = "page_form"):
54
- col1, col2 = st.columns(2)
55
- with col1:
56
- s_page = st.selectbox(label = "Start Page", options = pgs)
57
- with col2:
58
- e_page = st.selectbox(label = "End Page", options = pgs, index = pgs[-1]-1)
59
- submit_pages = st.form_submit_button(label = "Convert To Audio")
60
 
61
  if submit_pages:
62
  if start_page > end_page:
 
38
  if submit_paper:
39
  paper = get_paper(pname)
40
 
41
+ name=""
42
  if paper:
43
  name = paper.title+'.pdf'
44
  name = name.replace('?', '')
45
  name = "downloads/" + name
46
 
47
+ tpages = len(list(extract_pages(name)))
48
+ print("total pages=", tpages)
49
+ pgs = [i+1 for i in range(tpages)]
50
 
51
+ start_page = 1
52
+ end_page = 1
53
 
54
+ with st.form(key = "page_form"):
55
+ col1, col2 = st.columns(2)
56
+ with col1:
57
+ s_page = st.selectbox(label = "Start Page", options = pgs)
58
+ with col2:
59
+ e_page = st.selectbox(label = "End Page", options = pgs, index = pgs[-1]-1)
60
+ submit_pages = st.form_submit_button(label = "Convert To Audio")
61
 
62
  if submit_pages:
63
  if start_page > end_page: