Skip to content

Commit 96dc023

Browse files
committed
Add requirements.txt documentation to README
1 parent bc79e9e commit 96dc023

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@ You can upload assets (images, fonts, shaders, CSVs) via the sidebar. These are
5454
- **p5.js**: `P5.loadImage("cat.png")` works as expected (the system intercepts the call and provides the stored data).
5555
- **Shaders**: You can create `.vert` and `.frag` files and load them using `P5.loadShader("shader.vert", "shader.frag")`.
5656

57+
### External Packages (requirements.txt)
58+
To use external Python packages (like `numpy`, `pandas`, `faker`), create a file named `requirements.txt` in your project's root.
59+
60+
1. **Create File**: Click "New File" -> `requirements.txt`.
61+
2. **Add Packages**: List one package per line.
62+
```text
63+
numpy
64+
pandas
65+
```
66+
3. **Import**: In your `sketch.py`, import them as usual.
67+
```python
68+
import numpy as np
69+
def setup():
70+
print(np.array([1, 2, 3]))
71+
```
72+
The runner will automatically install these packages from PyPI (via Pyodide/Micropip) before starting your sketch.
73+
5774
### Snake Case Support
5875
You can optionally write p5.js code using `snake_case`. The IDE automatically converts it to `camelCase`.
5976
- `create_canvas(400, 400)` -> `P5.createCanvas(400, 400)`
@@ -132,7 +149,7 @@ def setup():
132149
## Deployment & Hosting
133150

134151
### GitHub Pages
135-
This project is ready to be hosted on GitHub Pages. The `index.html` redirects to `ide.html`.
152+
This project is hosted on GitHub Pages. The `index.html` redirects to `ide.html`.
136153

137154
### Local Hosting
138155
Due to CORS/Module security, you must use a local web server:

0 commit comments

Comments
 (0)