This repo is a compilation of tutorials and examples using PyScript
which embeds python into HTML. PyScript is a 'micro front-end', similar to Angular or React.
I created this repo for project research on Python Web Apps.
- Install JS Backend Framework: Node.js
- Install the Node Package Manager: npm
- Install a Python Environment: Download Python
Optional but highly recommended:
-
Install the Node Version Manager: NVM
- This allows multiple versions of NPM to be installed as parallel installations.
-
Install a Python Environment Management system like Anaconda or Miniconda.
- This allows multiple versions of Python to be installed as parallel environments.
-
Add the
mamba
package dependency solver, which is much faster than the pre-existingconda
package dependency solver:conda install mamba
- Refer to the docs for
mamba
- Refer to the docs for
-
Another alternative is the
Miniforge3
akaMambaForge
which "holds the minimal installers for Conda and Mamba specific to conda-forge, with the following features pre-configured:- Packages in the base environment are obtained from the conda-forge channel.
- The conda-forge channel is set as the default (and only) channel."
- Note that with PyScript, the
<py-script>
tag that is used to run python code. This is the 'main' tag used.<py-script>
is used to display results (output, pyscrit.write), DOM Manipulation, and other python based operations (like batch, webservices).<py-script>
is used in two ways: Python code written in HTML in the same page, or usingsrc
attributes in the tag (externalization of python code).
- The
<py-env>
tag is used to import Python Libraries into the DOM. - The
<py-repl>
tag is used to add a python terminal to the DOM.
- PyScript GitHub Page.
Documentation (start here):
- PyScript Docs Home Page. Bookmarks Below:
- PyScript 2024.1.1 User Guide
- Example Applications that are open source with live demos.
- Alternative Link to Example Applications that are open source with live demos.
Video Tutorials:
- PyScript: The Complete Guide by Run Nano, 2:03:00 duration.
- Covers the following: DOM Manipulation, CRUD Operations, Event Management, Custom Components, and Data Science Applications.
Tutorial Articles: