[FEATURE] Use `script` tag instead of custom `py-script`
See original GitHub issueIssue Analytics
- State:
- Created a year ago
- Comments:15 (1 by maintainers)
Top Results From Across the Web
Intro to PyScript: Run Python in the browser - LogRocket Blog
Learn how to deploy Python code in the browser using PyScript, a new library that builds of Pyodide and ports CPython to Wasm....
Read more >A First Look at PyScript: Python in the Web Browser
So far, you've seen the <py-script> and <py-config> custom tags provided by the framework. Another element that you'll often want to use is ......
Read more >PyScript Beta Lets You Run Python in the Browser - MakeUseOf
Write Python Directly Inside HTML. Your Python code sits inside a custom py-script tag within a document's body. The PyScript JavaScript file ...
Read more >Now, You Can Build Client-Side Apps With Python.
An excellent alternative is to link our python file to the py-script tag instead of writing it inside the HTML block. We'll use...
Read more >PyScript Tutorial | Run Python Script in the Web Browser
In the above code, we use the <py-env> inside the body tag, which takes a YAML list that has paths as its key....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t question that the average person can edit HTML tags - that’s why PyScript leverages HTML. 😃
However, coming from a background of teaching Python and computers to many, many non-programmer types, it is my experience that every single additional character, symbol, etc. is a rock in their shoe. Especially if this is something that has to get typed repeatedly in various sections of the HTML.
If the
<script>
tag were only to appear once, in the<head>
, then that’d be one thing. But it has to appear every single time that a user wants to insert some Python. This could be in the event handler of a button. This could be within some snippet of d3. Every. Single. Place. has to now expand to a much more verbose, more error-prone pile of text. And if the user mistypes it?<script type="python">
or<script type="text/python">
instead of<script type="text/x-python">
? Then our JS preprocessor will silently ignore it, and the user won’t understand why their thing didn’t work.And none of this removes the fact that there will be
<py-repl>
,<py-ui>
, and may other kinds of tags within the PyScript framework.I really don’t understand what the hang-up is. WebComponents are a standard part of HTML. Angular and many other frameworks define their own tag. Why can’t PyScript?
This is a design issue. As maintainers, we have given our rationale, rooted in the overall philosophy of the project, which is to make things easy to use for non-experts and novices.
I am locking the issue to avoid further sniping and bikeshedding.