Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple scripts #4

Closed
whitphx opened this issue May 19, 2022 · 0 comments · Fixed by #132
Closed

Multiple scripts #4

whitphx opened this issue May 19, 2022 · 0 comments · Fixed by #132

Comments

@whitphx
Copy link
Owner

whitphx commented May 19, 2022

Support inputting multiple Python files that are imported from the main script file.


The mountable API would be like this?
This is more general design that covers not only Python scripts but also other types of files.

stlite.mount({
  entrypoint: "streamlit_app.py",
  files: {
    // Python files
    "streamlit_app.py": `
import streamlit as st
...
    `,
    "pages/page1.py": `
# This is the first page.
    `,
    "pages/page2.py": `
# This is the second pae.
    `,
    // Other files, e.g. data files
    "data/foo.csv":  // Text file
`id,name
1,Bob
2,Alice
`,
    "data/secret.dat": new ArrayBuffer(/* Some data */), // Binary file
    "models/foo.h5": fetch("...")  // Support async API?
    "models/compressed.h5": {
      url: "....zip",
      unpack: true. // Unpack the archive: https://pyodide.org/en/stable/usage/faq.html#how-can-i-load-external-files-in-pyodide
    }
  }
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant