/pythonocc_streamlit

a way to interact with pythonocc webbrowser display using streamlit

Primary LanguagePythonGNU Lesser General Public License v2.1LGPL-2.1

pythonocc_streamlit

a way to interact with pythonocc webbrowser display using streamlit

Installation

Prerequisites:

  1. streamlit: https://streamlit.io/
  2. pythonocc-core: https://github.com/tpaviot/pythonocc-core
# first create an environment
conda create --name=pyoccenv python=3.9
source activate pyoccenv  /alternate command/ conda activate pyoccenv
conda install -c conda-forge pythonocc-core=7.7.0
pip install streamlit

Usage

In your terminal, with your conda env activated, just type:

streamlit run path_to_your_file/example_streamlit_pythonocc.py

Examples

Here a small example of application:

screenshot_1 screenshot_2

How it works

As pythonocc server refresh when streamlit rerun, we had to let the .render() function return the new server's address to pass it to the iframe