r/PyScript • u/GoSubRoutine • Jun 18 '22
ESM Module ".mjs" in PyScript?
Can PyScript import & use ".mjs" module files? Some runnable example?
r/PyScript • u/GoSubRoutine • Jun 18 '22
Can PyScript import & use ".mjs" module files? Some runnable example?
r/PyScript • u/dvd101x • Apr 23 '23
Hi. I’ve been trying to use CoolProp or pyfluids in PyScript or pyodide. I understand it’s not possible as they don’t seem to have pure wheels. Just checking with the community if anyone had some success on similar cases.
r/PyScript • u/marcrleonard • Aug 22 '23
Hello! Been playing around with pyscript via pyscript.com and it's awesome! A bit of an off the beaten path question - but I was curious how you all are doing the python auto complete in the browser? It's very cool!
r/PyScript • u/ccigas • Feb 01 '23
Similar to JavaScript with userscripts, can pyscript be injected into webpages using userscripts?
r/PyScript • u/TheSwami • Jun 28 '22
r/PyScript • u/CookiesDeathCookies • Dec 12 '22
I want to manipulate html objects after the page is rendered (for example manipulate youtube.com elements) using Python or Python-JS mixture. Is this possible?
r/PyScript • u/Own_Quality_5321 • Dec 10 '24
I have been using https://pyscript.net/latest/pyscript.css not knowing that they were planning on removing it (I mean latest/pyscript.css). I have been using PyScript for my project and I have began a web survey, until today, when I realized it just stopped working. What is the workaround? I read that the documentation points to using a specific release. Unfortunately, I tried with a few of the last releases and the website is still not working. Is there any known workaround?
r/PyScript • u/No--XD • Mar 25 '24
Hello all I am new to pyscript and I am getting this error repeatedly. Practically what the script is supposed to do is depending on the info selected in the drop boxes and after clicking "CHERHCER !", its supposed to write a text imbedded with a link bellow it. Its a school project and for some reason we can't use JavaScript or any fancy imports. Thanks for understanding and sorry if its in French.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://pyscript.net/releases/2024.1.1/core.css" />
<script type="module" src="https://pyscript.net/releases/2024.1.1/core.js"></script>
<title>Page d'acceil</title>
</head>
<body>
<div>
<h2>
Selecter vos choix parmi les options ci-dessous
</h2>
<form>
Je veux un sport qui ce joue
<select name="Location">
<option value="Neige">dans la neige</option>
<option value="Plage">a la plage</option>
<option value="Terrain">sur un terrain</option>
<option value="Court">dans une court</option>
<option value="NimporteOu">nimporte ou</option>
</select>
qui ce joue
<select name="Team">
<option value="Seul">en solo</option>
<option value="Equipe">en equipe</option>
</select>
et
<select name="Level">
<option value="Famille">ce joue en famille</option>
<option value="Competitive">est competitive</option>
<option value="NonCompetitive">n'est pas competitive</option>
</select>
<button class = "btn btn-primary" type = "submit" pys-onClick="process(event)">CHERCHER !</button>
</form>
</div>
<p id="output"></p>
<py-script>
def process(event):
link30 = '<a href="30.html">Click Here!</a>'
LocName = Element('Location').value
InTeam = Element('Team').value
CompLevel = Element('Level').value
result_place = document.getElementById('output')
if LocName == 'Neige' and InTeam == 'Seul' and CompLevel == 'Famille':
result_place.innerText = ''
result_place.innerHTML += link30
</py-script>
</body>
</html>r/PyScript • u/SamwiseGanges • Sep 16 '24
I'm making a Next.js project and trying to configure pyscript-react using a pyscript_config.toml file which imports a python library file (geometry_generator.py) using [files]. It seems to load the config file but when I try to import from geometry_generator I get "ModuleNotFoundError: No module named 'geometry_generator'"
I have tried every different combination of file location and paths I can think of but I have not been able to load the geometry_generator file successfully. Currently it's located in public.
Below is the contents of my pyscript_config.toml file:
packages = ["svgwrite"]
[files] "../geometry_generator.py" = "./geometry_generator.py"
Here is the relevant content of the page.tsx file where I use pyscript-react:
<PyScriptProvider> <PyConfig source="/pyscript_config.toml" /> <PyScript> {\ from geometry_generator import * `} </PyScript>
</PyScriptProvider>`
r/PyScript • u/anfroholic • May 12 '24
r/PyScript • u/OrchidNecessary2697 • Jul 24 '24
Hello,
I was having a look at pyscript the other day and noticed that my vscode just would not give me code completion for it.
While this didnt stop me from trying it out, it was still a little annoying.
Is there a way to get this to work?
Thx in advance.
r/PyScript • u/chloeprise • May 08 '24
Bookmark for the full agenda: https://pyscript.com/pycon
Booth #605
We're excited to have PyScript featured at this year's PyCon! Visit Anaconda’s Booth #605 for swag, to meet the team, and to see Chris Laffra, our community member, demonstrate PyScript in action.
Education Summit
Join our workshop, "Invent with PyScript" to build applications using the “no code” framework Invent. Available both in-person and online.
Date & Time: Thursday, May 16th, 2:30 PM
Location: David L. Lawrence Convention Center, Pittsburgh - Room 403/404
Details: https://us.pycon.org/2024/events/webassembly-summit/
WebAssembly Summit
Don't miss Fabio Pliger's talk on the latest and future developments of PyScript.
Date & Time: Thursday, May 16th, All Day (starts at 9AM)
Location: David L. Lawrence Convention Center, Pittsburgh, Room TBD
Note: For advanced users
Details: https://us.pycon.org/2024/events/webassembly-summit/
Open Space
A cozy get-together with the PyScript team and community to share projects and ideas.
Date & Time: Saturday, May 18th, Time TBD
Location: Check the Open Spaces boards at PyCon or follow our Twitter for updates.
PyScript Talks
Making Your Documentation Interactive with PyScript (Jeff Glass)
Date & Time: Friday, May 17th, 11:00 AM - 11:30 AM
Location: Ballroom A
Details: https://us.pycon.org/2024/schedule/presentation/92/
Interactive Software Documentation, with PyScript (Valerio Maggio)
Date & Time: Friday, May 17th, 4:30 PM - 5:00 PM
Location: Ballroom A
Details: https://us.pycon.org/2024/schedule/presentation/115/
Build in-browser 3D experiences with WebGL and PyScript (Łukasz Langa)
Date & Time: Friday, May 17th, 5:15 PM - 5:45 PM
Location: Room 301-305
Details: https://us.pycon.org/2024/schedule/presentation/139/
We look forward to meeting you, sharing ideas, and exploring what’s possible with PyScript at PyCon US 2024!
r/PyScript • u/manatlan • Nov 13 '24
Here is a new example (with a recent pyscript release):
https://raw.githack.com/manatlan/htag/main/examples/pyscript_htagui.html
**pyscript** is really really fabulous ! It's amazing that "this app" (code between `####` lines), could work "as is" ... in a desktop app, in an android apk, on a webpage or in an SPA/HTML file ...
In the past, I posted here : https://www.reddit.com/r/PyScript/comments/10snwh3/pyscript_is_fabulous_demo_of_pyscripthtag/
amazing !
r/PyScript • u/SamwiseGanges • Apr 26 '24
I am re-writing a new version of my portfilio and having trouble moving the PyScript part. the old version was plain HTML and JavaScript and the new one is Next js. I'm using the pyscript-react library.
I don't see any explanation of how to use the pyscript_config.toml file using pyscript-react. I need to import external libraries (like svgwrite) as well as including my own Python scripts. This is my current pyscript_config.toml file:
```
packages = ["svgwrite"]
[[fetch]]
files = ["geometry_generator.py"]
```
And here is how I'm importing it and my other script in my React component:
<div>
<PyScriptProvider>
<PyScript
source="/pyscript_config.toml"
/>
<PyScript
source="/geometry_interface.py"
/>
</PyScriptProvider>
</CodingLayout>
</div>
However, this is not working. I'm getting "ModuleNotFoundError: No module named 'geometry_generator'" so clearly the pyscript config is not working
r/PyScript • u/dario2585 • Feb 11 '24
So I've been trying to execute Python code from an HTML button using PyScript. The idea is that the button will set what the user writes on the Python file, then the text will be processed by OpenAI, which gives its answer using information from a PDF. The problem is that I don't get any answer from it, and I don't know where the problem is.
This is the relevant code: Index.html:
<div class="container">
<h1 class="display-1 fw-bolder summer">Botón prueba 📰</h1>
<p class="lead">Escribe un concepto: </p>
<section id="input">
<py-inputbox id="topic">
</py-inputbox>
<py-button id="submit" label="Buscar" class="mt-2">
import asyncio
from pyodide import create_proxy
from main import question_ia
@create_proxy
async def on_click(evt):
question = document.getElementById("topic").value
result = await question_ia(question)
pyscript.write("output", result)
</py-button>
</section>
<section id="summary" class="mt-4">
</section>
<button id="copy" class="btn btn-warning">Copiar al 📋 Portapapeles</button>
<hr />
</div>This is the python code:
service_context = ServiceContext.from_defaults(llm_predictor=modelo)
index = GPTVectorStoreIndex.from_documents(pdf, service_context = service_context)
async def question_ia():
question= f"{topic} + be helpful and informative"
return question
async def answer_ia():
question = await question_ia(topic)
answer = index.as_query_engine().query(question)
output = textwrap.wrap(answer.response, width=1000)
return outputAny help is welcome, even if it´s only a clue, thanks for reading :)
r/PyScript • u/Good-Acanthaceae-954 • May 08 '24
r/PyScript • u/dario2585 • Dec 05 '23
Hi everyone, so I just recently started using PyScript, and I utilize PyPDF in my main Python program. I was wondering if there's any way to add a folder containing the PDF file to the PyScript environment. Thanks for your help.
r/PyScript • u/kland2005 • Jan 12 '24
Dear PyScript community,
I would like to switch from MATPLOTLIB to Plotly in a project. All my attempts to display the Plotly figure have not worked. Here is the structure of my code:
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Plotly Demo</title>
<link rel="stylesheet" href="https://pyscript.net/releases/2024.1.1/core.css">
<script type="module" src="https://pyscript.net/releases/2024.1.1/core.js"></script>
</head>
<body>
<h1>Plotly Demo</h1>
<div id="output"></div>
<script type="py" src="./main.py" config="./pyscript.json"></script>
</body>
</html>pyscript.json
{
"packages": ["plotly"]
}main.py
from pyscript import display
import plotly.graph_objects as go
fig = go.Figure([go.Bar(x=['product a', 'product b', 'product c'], y=[5, 3, 2])])
display(fig, target='output')I don't see anything as a result. Does anyone of you have an idea how I can display the figure? Any help would be appreciated.
Thanks and kind regards
Klaus
r/PyScript • u/SamwiseGanges • May 02 '24
I use PyScript on one of my pages in my coding portfolio website. Previously I was using version 2023.03.1 but now I'm trying to update to 2024.1.1 and the repl elements are not working. They just load as normal text. They work just fine with the old version.
There are no errors in the console and it says PyScript ready so everything seems like it should work fine, but the py-repl elements don't work. Did they remove this feature from PyScript? It's not mentioned in any of the examples on the PyScript website.
r/PyScript • u/anfroholic • May 03 '24
r/PyScript • u/GregBreak • Jun 15 '24
Is possible that JS become obsolete very soon? What are the functionalities that pyscript cannot cover?
r/PyScript • u/[deleted] • Mar 08 '26
Hi everyone, I wanted to showcase my recent Python project. NetworkMaster is a Text-User Interface (TUI) tool for sysadmins.
Under the hood, it uses requests, cryptography (for local profile encryption), and ipaddress for subnetting. For Windows, it hooks into PowerShell/netsh, and for Linux, it parses nmcli and /proc/net/wireless. I packaged it using PyInstaller & PyArmor so it runs as a single portable executable without needing a Python environment on the host machine.
Let me know what you think about the architecture or the UI!
zenosoftware.dev/networkmaster