mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 18:27:29 -05:00
pre-commit.ci has been disabled for a while. This PR ensures that all the files has been validated/formatted by pre-commit, to avoid spurious diffs in subsequent PRs. During the process, ruff broke the code because it removed an "unused" import which was actually used. A linter which breaks my code is a linter which I cannot trust, so I just removed it. I re-enabled isort instead.
55 lines
1.8 KiB
HTML
55 lines
1.8 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<link rel="stylesheet" href="https://unpkg.com/mvp.css@1.12/mvp.css" />
|
|
<link rel="stylesheet" href="_PATH_core.css" />
|
|
<script type="module" src="_PATH_core.js"></script>
|
|
<title>PyScript</title>
|
|
</head>
|
|
|
|
<body>
|
|
<main>
|
|
<h1><py-script></h1>
|
|
<ul>
|
|
<li><a href="core.js">core.js</a></li>
|
|
<li><a href="core.js.map">core.js.map</a></li>
|
|
<li><a href="core.css">core.css</a></li>
|
|
</ul>
|
|
<div id="out"></div>
|
|
<py-script>
|
|
from pyscript import display
|
|
import sys
|
|
display(sys.version)
|
|
</py-script>
|
|
|
|
<h2>Example</h2>
|
|
<pre style="padding: 1em; border: 1px solid #000000">
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
<title>PyScript Hello World</title>
|
|
<link rel="stylesheet" href="_PATH_core.css" />
|
|
<script type="module" src="_PATH_core.js"></script>
|
|
</head>
|
|
|
|
<body>
|
|
Hello world! <br>
|
|
This is the current date and time, as computed by Python:
|
|
<py-script>
|
|
from pyscript import display
|
|
from datetime import datetime
|
|
now = datetime.now()
|
|
display(now.strftime("%m/%d/%Y, %H:%M:%S"))
|
|
</py-script>
|
|
</body>
|
|
</html></pre
|
|
>
|
|
</main>
|
|
</body>
|
|
</html>
|