Here's part 1: kzbin.info/www/bejne/h6CblYuvgL2sg6c : Focus on importing PyScript, its syntax and key usage patterns. A get started guide for anyone new to pyscript. Here's part 2: kzbin.info/www/bejne/pXnCo4eKec-ArK8. This takes a full PyScript and deploy it onto GitHub Pages (using GitHub Action) for free! We'll use a lot of the same knowledge here but get to see an end-to-end deployment too! Part 3 kzbin.info/www/bejne/q5i2c5SFiZWljKs will see us build a fully interactive analytics dashboard with Altair and PyScript. Part 4 (this video!) we'll build a CRUD (create read update delete) system in the form of a guest book using PyScript. This is something you'd do with Vue or React in the past, but now it's only a few lines of Python code. Subscribe to the channel and leave other future ideas here!
@brucewernick65422 жыл бұрын
I see examples showing complicated stuff like using numpy and matplotlib. But, how do you get the value from a simple html input?
@SamuelChan2 жыл бұрын
In this video, we set up the input at 11:40 with: Then we get the value by referencing the new_entry.value. You saw me do the new_entry.value.split(','). Are there ways to get value from html input without using py-inputbox? Yes. That requires you to selectElementByID() in javascript (I covered that in part 2 of the series too). The method I use in part 4 (this video) is probably easier though.
@brucewernick65422 жыл бұрын
Thanks. I can see res in the console but how do you write it below the inout? def on_keypress(e): if (e.code == "Enter"): res = Element("newval") console.log(res.value)
@SamuelChan2 жыл бұрын
To use things like console or document, you will have to do; from js import console, document console.log(res.value) Since they’re something that js has access to. I’ll touch on that in the next video :)
@brucewernick65422 жыл бұрын
OK, I have managed to make a simple demo. PyScript from js import document result = "the answer is 42!" pyscript.write("result", result)
@PtolemySoter2 жыл бұрын
Is there a way to read HTML Form posted values with py-script?
@SamuelChan2 жыл бұрын
Yes it’s something we do in Part 2 my bro; We use the HTML form in that tutorial :) kzbin.info/www/bejne/pXnCo4eKec-ArK8
@editssinfinity53552 жыл бұрын
Hey, Can anyone tell me how to render another html page using pyscript?
@virencablenet95462 жыл бұрын
Hi Bro Your html page should contain Choose file and submit button And on submit button read Uploaded file and print that data on web
@SamuelChan2 жыл бұрын
Thanks for the idea my bro. I wanted to stick to the CRUD pattern more in part 4 - I can create a part 5 in this series to explore the file submission pattern when I’ve got time? 😀 thanks for the suggestion though! 🙏🏼
@virencablenet95462 жыл бұрын
@@SamuelChan ya please this above approach is more important. All the stuff you show is easily available. But approach i ask no one as made so far any video on it. Mostly probably if you could get me by tomorrow will be great helpful