Spaces:
Runtime error
Runtime error
| 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) | |