© Copyright | Created by the Girl with a ribbon ξ(🎀˶❛◡❛) | Built with <pyscript> JavaScript plugin

List of pyscript tags - Simple Printouts
Code SnippetFinal Output
<py-script>print('Hello, World!')</py-script> print('Hello, World!')
                    <py-script>
                def wallis(n):
                    pi = 2
                    for i in range(1,n):
                        pi *= 4 * i ** 2 / (4 * i ** 2 - 1)
                    return pi
                pi = wallis(100000)
                pyscript.write('pi', f'π is approximately {pi:.3f}')
                    </py-script>
                
def wallis(n): pi = 2 for i in range(1,n): pi *= 4 * i ** 2 / (4 * i ** 2 - 1) return pi pi = wallis(100000) pyscript.write('pi', f'π is approximately {pi:.3f}')
                    <py-script>
                import datetime as dt
                pyscript.write('today', dt.date.today().strftime('%A %B %d, %Y'))
                    </py-script>
                
import datetime as dt pyscript.write('today', dt.date.today().strftime('%A %B %d, %Y'))

Today is

List of pyscript tags - Numpy and matplotlib
Code SnippetFinal Output
                        <py-env>
                    - numpy
                    - matplotlib
                        </py-env>
                        <h1>Let's plot random numbers</h1>
                        <div id="plot"></div>
                        <py-script output="plot">
                    import matplotlib.pyplot as plt
                    import numpy as np

                    x = np.random.randn(1000)
                    y = np.random.randn(1000)

                    fig, ax = plt.subplots()
                    ax.scatter(x, y)
                    fig
                        </py-script>
                    
- numpy - matplotlib

Let's plot random numbers

import matplotlib.pyplot as plt import numpy as np x = np.random.randn(1000) y = np.random.randn(1000) fig, ax = plt.subplots() ax.scatter(x, y) fig
List of pyscript tags
Code SnippetFinal Output
                        <py-env>
                    - numpy
                    - matplotlib
                        </py-env>
                        <h1>Let's plot random numbers</h1>
                        <div id="plot"></div>
                        <py-script output="plot">
                    import matplotlib.pyplot as plt
                    import numpy as np

                    x = np.random.randn(1000)
                    y = np.random.randn(1000)

                    fig, ax = plt.subplots()
                    ax.scatter(x, y)
                    fig
                        </py-script>
                    
- numpy - seaborn - matplotlib

Let's plot random numbers

import numpy as np import seaborn as sns import matplotlib.pyplot as plt fig, ax = plt.subplots() ax.scatter(x, y) fig