tjxj commited on
Commit
0d70c9b
·
1 Parent(s): 0b93b46

Add application file

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -5,12 +5,17 @@ import streamlit as st
5
  import base64
6
  import subprocess # process in the os
7
  from subprocess import STDOUT #os process manipuation
8
- import os,sys
9
  import camelot as cam # extracting tables from PDFs
10
 
11
  # to run this only once and it's cached
 
 
 
 
 
 
12
 
13
- sys('apt-get install -y ghostscript')
14
  st.title("PDF Table Extractor")
15
 
16
  input_pdf = st.file_uploader(label = "", type = 'pdf')
 
5
  import base64
6
  import subprocess # process in the os
7
  from subprocess import STDOUT #os process manipuation
8
+ import os
9
  import camelot as cam # extracting tables from PDFs
10
 
11
  # to run this only once and it's cached
12
+ def gh():
13
+ """install ghostscript on the linux machine"""
14
+ proc = subprocess.Popen('apt-get install -y ghostscript', shell=True, stdin=None, stdout=open(os.devnull,"wb"), stderr=STDOUT, executable="/bin/bash")
15
+ proc.wait()
16
+
17
+ gh()
18
 
 
19
  st.title("PDF Table Extractor")
20
 
21
  input_pdf = st.file_uploader(label = "", type = 'pdf')