Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
user:hof:pyeditor [2025-01-06 12:26] – [JupyterLite] hof | user:hof:pyeditor [2025-06-06 08:25] (aktuell) – [Bottom.ch with direct component] hof | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
# Inline Python Editors | # Inline Python Editors | ||
- | ## Bottom.ch with iframe | + | ## Bottom.ch with direct component |
- | With iframe on bottom.ch/ | + | This is the preferred version as of 2025. |
- | <code html> | ||
- | < | ||
- | |||
- | < | ||
- | |||
- | |||
- | ## Bottom.ch with direct component | ||
<code html> | <code html> | ||
<!-- Include the script once (or from a DokuWiki plugin, or from userscripts. --> | <!-- Include the script once (or from a DokuWiki plugin, or from userscripts. --> | ||
Zeile 15: | Zeile 8: | ||
<!-- Include a custom component in HTML. Use height, min-height, max-height to control the size. --> | <!-- Include a custom component in HTML. Use height, min-height, max-height to control the size. --> | ||
- | < | + | <!-- Leading empty lines will be dropped. --> |
+ | < | ||
+ | print(42) | ||
+ | </ | ||
</ | </ | ||
+ | |||
< | < | ||
- | < | + | < |
+ | |||
+ | You can install files from an URL (with CORS headers if from a different domain!): | ||
+ | |||
+ | <code html> | ||
+ | < | ||
+ | with open(' | ||
+ | for line in infile: | ||
+ | tokens = line.split(',' | ||
+ | town = tokens[0] | ||
+ | if town == ' | ||
+ | print(f' | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | with open(' | ||
+ | for line in infile: | ||
+ | tokens = line.split(',' | ||
+ | town = tokens[0] | ||
+ | if town == ' | ||
+ | print(f' | ||
+ | </ | ||
+ | |||
+ | |||
+ | ## Bottom.ch with iframe | ||
+ | With iframe on bottom.ch/ | ||
+ | |||
+ | <code html> | ||
+ | < | ||
+ | |||
+ | < | ||
## JupyterLite | ## JupyterLite | ||
Zeile 30: | Zeile 59: | ||
| | ||
| | ||
- | <iframe | + | < |
src=" | src=" | ||
width=" | width=" | ||
- | height=" | + | height=" |