Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf5a6a87

Browse files
committed
Merge branch 'main' into quickfix/pyscript_loading_sequence
2 parentsede0ada +b77b8ca commitf5a6a87

File tree

12 files changed

+34
-23
lines changed

12 files changed

+34
-23
lines changed

‎GETTING-STARTED.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,17 @@ pyscript.write('pi', f'π is approximately {pi:.3f}')
114114

115115
In addition to the[Python Standard Library](https://docs.python.org/3/library/) and
116116
the`pyscript` module, many 3rd-party OSS packages will work out-of-the-box with PyScript.
117-
In order to use them you will need to declare the dependencies using the`<py-env>` in the
118-
HTML head.
117+
118+
In order to use them you will need to delcare the dependencies using the`<py-env>` in the
119+
HTML head. You can also link to`.whl` files directly on disk like in our[toga example](https://github.com/pyscript/pyscript/blob/main/pyscriptjs/examples/toga/freedom.html)
120+
121+
```
122+
<py-env>
123+
- './static/wheels/travertino-0.1.3-py3-none-any.whl'
124+
</py-env>
125+
```
126+
127+
If your`.whl` is not a pure Python wheel then open a PR or issue with[pyodide](https://github.com/pyodide/pyodide) to get it added herehttps://github.com/pyodide/pyodide/tree/main/packages. If there's enough popular demand the pyodide team will likely work on supporting your package, regardless things will likely move faster if you make the PR and consult with the team to get unblocked.
119128

120129
For example, NumPy and Matplotlib are available. Notice here we're using`<py-script output="plot">`
121130
as a shortcut, which takes the expression on the last line of the script and runs`pyscript.write('plot', fig)`.
@@ -197,4 +206,5 @@ fig
197206
</py-script>
198207
</body>
199208
</html>
200-
```
209+
```
210+

‎README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,16 @@
55
###tl;dr
66
PyScript is a Pythonic alternative to Scratch, JSFiddle or other "easy to use" programming frameworks, making the web a friendly, hackable, place where anyone can author interesting and interactive applications.
77

8-
To demonstrate pyscript, see[the pyscript folder](pyscriptjs/README.md).
8+
To get started see[GETTING-STARTED](GETTING-STARTED.md).
9+
10+
For examples see[the pyscript folder](pyscriptjs/README.md).
911

1012
###Longer Version
1113
PyScript is a meta project that aims to combine multiple open technologies to create a framework for users to use Python (and other languages) to create sophisticated applications in the browser. It highly integrates with the way the DOM works in the browser and allows users to add logic, in Python, in a way that feels natural to web as well as Python developers.
1214

1315
##Try PyScript
1416

15-
To try PyScript, import the pyscript to your html page with:
17+
To try PyScript, import theappropriatepyscript files to your html page with:
1618
```
1719
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
1820
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
@@ -28,9 +30,9 @@ Check out the `/examples` folder for more examples on how to use it, all you nee
2830

2931
To contribute:
3032

31-
* clone the repo
33+
* clone the repo`git clone https://github.com/pyscript/pyscript`
3234
* cd into the main project folder with`cd pyscriptjs`
33-
* install the dependencies with`npm install`
35+
* install the dependencies with`npm install` - make sure to use nodejs version >= 16
3436
* run`npm run dev` to build and run the dev server. This will also watch for changes and rebuild when a file is saved
3537

3638
##Resources

‎pyscriptjs/examples/antigravity.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</head>
99
<py-env>
1010
- paths:
11-
- /antigravity.py
11+
-./antigravity.py
1212
</py-env>
1313
<body>
1414
<b>Based on xkcd: antigravity https://xkcd.com/353/.</b>

‎pyscriptjs/examples/numpy_canvas_fractals.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<inputid="y1"type="text"value="5.0"style="width: 80px; text-align: right">
6767
<spanstyle="white-space: pre">]</span>
6868
</div>
69-
<divstyle="display: flex; flex-direaction: row; gap: 1em">
69+
<divstyle="display: flex; flex-direction: row; gap: 1em">
7070
<divstyle="white-space: pre"><inputtype="radio"id="conv"name="type"value="convergence"checked> convergence</div>
7171
<divstyle="white-space: pre"><inputtype="radio"id="iter"name="type"value="iterations"> iterations</div>
7272
</div>
@@ -82,8 +82,8 @@
8282
- numpy
8383
- sympy
8484
- paths:
85-
- /palettes.py
86-
- /fractals.py
85+
-./palettes.py
86+
-./fractals.py
8787
</py-env>
8888

8989
<py-script>

‎pyscriptjs/examples/panel_deckgl.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
<metaname="apple-mobile-web-app-capable"content="yes">
77
<metaname="apple-mobile-web-app-status-bar-style"content="default">
88
<metaname="theme-color"content="#0072b5">
9-
<metaname="name"content="Pyscript/Panel DeckGL Demo">
9+
<metaname="name"content="PyScript/Panel DeckGL Demo">
1010

11-
<title>Pyscript/Panel DeckGL Demo</title>
11+
<title>PyScript/Panel DeckGL Demo</title>
1212
<linkrel="icon"type="image/x-icon"href="./favicon.png">
1313

1414
<linkrel="stylesheet"href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"type="text/css"/>

‎pyscriptjs/examples/repl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
<py-env>
1515
- paths:
16-
- /antigravity.py
16+
-./antigravity.py
1717
</py-env>
1818

1919
<body>

‎pyscriptjs/examples/repl2.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
- bokeh
1818
- numpy
1919
- paths:
20-
- /utils.py
21-
- /antigravity.py
20+
-./utils.py
21+
-./antigravity.py
2222
</py-env>
2323

2424
<body>

‎pyscriptjs/examples/simple_clock.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<scriptdefersrc="../build/pyscript.js"></script>
1313
<py-env>
1414
- paths:
15-
- /utils.py
15+
-./utils.py
1616
</py-env>
1717
</head>
1818

‎pyscriptjs/examples/todo.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<scriptdefersrc="/build/pyscript.js"></script>
1313
<py-env>
1414
- paths:
15-
- /utils.py
15+
-./utils.py
1616
</py-env>
1717
</head>
1818

‎pyscriptjs/src/components/pyenv.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import*asjsyamlfrom'js-yaml';
22

3-
import{pyodideLoaded,loadedEnvironments,mode,addInitializer}from'../stores';
3+
import{pyodideLoaded,addInitializer}from'../stores';
44
import{loadPackage,loadFromFile}from'../interpreter';
55

66
// Premise used to connect to the first available pyodide interpreter

‎pyscriptjs/src/components/pytitle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import{BaseEvalElement}from'./base';
2-
import{addClasses,ltrim,htmlDecode}from'../utils';
2+
import{addClasses,htmlDecode}from'../utils';
33

44
exportclassPyTitleextendsBaseEvalElement{
55
shadow:ShadowRoot;

‎pyscriptjs/src/pyscript.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
fromjsimportdocument,setInterval,console
2-
importmicropip
1+
fromjsimportdocument,console
32
importasyncio
4-
importio,base64,sys
3+
importio,base64
54

65
loop=asyncio.get_event_loop()
76

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp