Spaces:
Runtime error
Runtime error
File size: 828 Bytes
66ba613 ffaa7ef 0b42c2e d503469 0df44ca ffaa7ef b1e406c 66ba613 b1e406c dfbdf03 b5a81a9 66ba613 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | import streamlit as st
import sys
from subprocess import call
from pathlib import Path
def run_cmd(command):
try:
print(command)
call(command, shell=True)
except KeyboardInterrupt:
print("Process interrupted")
sys.exit(1)
sys.path.append('diffvg')
if 'diffvg_installed' not in st.session_state:
st.session_state['diffvg_installed'] = True
pwd = Path.cwd().absolute().as_posix()
run_cmd('git submodule update --init --recursive')
run_cmd(f'cd diffvg && python setup.py install --install-lib {pwd} && cd ..')
st.write('Using submodule pixray')
import os
st.write(os.listdir('.'))
st.write('☝️ actually does have folder `pixray`')
st.write(os.listdir('./diffvg'))
st.write(run_cmd('pip freeze'))
x = st.slider('Select a value')
st.write(x, 'squared is', x * x)
|