PyScript - Run Python in the Browser! Will It Crush Javascript?!

  Рет қаралды 23,195

Codemy.com

Codemy.com

Күн бұрын

In this video we'll look at PyScript to run Python on a Webpage!
PyScript is a very cool project from the people at Anaconda that allows you to run Python straight on a webpage without any backend frameworks!
It's very early days, and there are a lot of problems with the project...but you can still check it out and play with it while they work on buidling out a stable version!
Grab My Intro To Python Book PDF: bit.ly/39XBqNP
#pyscript #codemy #JohnElder
Timecodes
0:00​​ - Introduction
1:40 - Use PyScript on a Webpage
2:40 - Using The py-script Tag
3:30 - Install PyScript On Your Computer?
5:22 - Use Variables With PyScript
6:42 - Use Lists With PyScript
7:29 - Use Logic With PyScript
8:35 - Conclusion

Пікірлер: 94
@benlong1062
@benlong1062 2 жыл бұрын
Wow, this sounds awesome. Can't wait to follow along with your upcoming videos about it.
@Codemycom
@Codemycom 2 жыл бұрын
I think it's going to be fun!
@MobbyG
@MobbyG 2 жыл бұрын
Pretty cool! Can’t wait to see what we can really do with it
@Codemycom
@Codemycom 2 жыл бұрын
Me too!
@pragyanprabhu3513
@pragyanprabhu3513 2 жыл бұрын
Really forward to watch your pyscript courses
@Codemycom
@Codemycom 2 жыл бұрын
Me too ;-)
@carlosnavamat
@carlosnavamat 2 жыл бұрын
The Heisenberg of Python... As always, great video man
@Codemycom
@Codemycom 2 жыл бұрын
Ha thanks
@timonnjuhigu5856
@timonnjuhigu5856 2 жыл бұрын
Wow exciting , it's gonna be a game changer!
@Codemycom
@Codemycom 2 жыл бұрын
Gonna be awesome!
@MP-wq5xe
@MP-wq5xe 2 жыл бұрын
Thanks for every codemy
@Codemycom
@Codemycom 2 жыл бұрын
Welcome!
@alexf4112
@alexf4112 Жыл бұрын
Cool presented 👍👍
@Codemycom
@Codemycom Жыл бұрын
Thanks!
@Tntpker
@Tntpker 2 жыл бұрын
If you dl it you need to compile the typescript which will create the pyscript js file, probably in a build/ directory, but it should be in the same folder as src/ is in
@Codemycom
@Codemycom 2 жыл бұрын
Too much hassle
@MrChrisLia
@MrChrisLia 2 жыл бұрын
do you think you could run tkinter inside? and possibly actualyl running an app that way? lol i do worry about cross site scripting though
@Codemycom
@Codemycom 2 жыл бұрын
I kind of doubt it...but I'm going to try! :-p
@stefenleung
@stefenleung 2 жыл бұрын
if it can access html content like JS do. you don't need ktinder.
@Draglox
@Draglox Жыл бұрын
@@stefenleung ong
@maatsWsson
@maatsWsson 2 жыл бұрын
Just bought the pdf copy John!
@Codemycom
@Codemycom 2 жыл бұрын
Awesome...enjoy!!
@Humon66
@Humon66 2 жыл бұрын
kzbin.info/aero/PLbZjGOlfmtUJ1CUWo43VlI-50Os_DygFe You might like these python videos
@kevincodes674
@kevincodes674 2 жыл бұрын
is it JavaScript that allows you to run Python, or actual Python? I also didn't see documentation on the website but I've seen example of it connecting to the DOM, which is pretty neat
@Codemycom
@Codemycom 2 жыл бұрын
I mean, they're certainly using Javascript in some way...the documentation isn't there yet.
@matex600
@matex600 2 жыл бұрын
yes super interested in this, would it be possible to use with django?
@Codemycom
@Codemycom 2 жыл бұрын
Why? You can already use Python on Django
@Amdesew
@Amdesew 2 жыл бұрын
This Is Super Cool
@Codemycom
@Codemycom 2 жыл бұрын
It really is!
@stefenleung
@stefenleung 2 жыл бұрын
But why? anything python can do but javascript can't? the main concern is how the python work with html and css. What's the method to get element id/class? can we directly write html content into the html page with python? I see it can work with numpy, matplotlib. Would like to see a tutorial or demo on those module work.
@Codemycom
@Codemycom 2 жыл бұрын
Javascript is a pain to use. Python is awesome
@ronnie6628
@ronnie6628 2 жыл бұрын
This this this this this this
@Codemycom
@Codemycom 2 жыл бұрын
@@ronnie6628 :-)
@Draglox
@Draglox Жыл бұрын
Element ids can be accessed with "pyscript.write(Id, Script of text)"
@arijitkumarkhanra389
@arijitkumarkhanra389 Жыл бұрын
How can I use it to take an input and like use the python script though it?
@johngiftakis9878
@johngiftakis9878 Жыл бұрын
Can we have a prefilled REPL tag?
@notmeitsabot8212
@notmeitsabot8212 Жыл бұрын
Can I use imports for this?
@404errorpagenotfound.6
@404errorpagenotfound.6 2 жыл бұрын
I have seen a few tutorials but none show any functionality from the client side ie interactivity on the rendered web page. That is the whole point of using js so the web page viewer can directly interact with the page and change it. I can't find a single example of pyscript having that functionality so the question is what is it for? Not trying to be negative.
@Codemycom
@Codemycom 2 жыл бұрын
As I said in the video, they're still working on this, it's very early days. Regardless, interactivity isn't remotely nearly the only "good" of a thing. There are a million reasons why you would want to use Python on a webpage regardless of interactivity. Though, there is interactivity already, there just isn't documentation of it yet.
@a5990cs
@a5990cs Жыл бұрын
Hi do you have any intructions to setup pyscript from my local machine without any external call? I mean, I need pyscript not calling to any other URL, just running from local files
@Codemycom
@Codemycom Жыл бұрын
no
@anilgupta5301
@anilgupta5301 2 ай бұрын
Hi ,so i have a python file that executes a game and a html file with button. So i want it like when the button is clicked my python game file will be executed and one can play the game ,vut i tried a lot of tutorial and evertime i got an error pls help me 😢
@ThankYouESM
@ThankYouESM 2 жыл бұрын
There's also Brython which I long ago somehow forgot to check out.
@Codemycom
@Codemycom 2 жыл бұрын
Interesting
@darknights5020
@darknights5020 Жыл бұрын
can we import opencv or tkinter or paho with pyscript
@Codemycom
@Codemycom Жыл бұрын
I mean...you import those things with python
@axelysm3463
@axelysm3463 2 жыл бұрын
How to save things on tkinter like example: You typed words on entry, and if you close the app and open it again, it will save the words
@Codemycom
@Codemycom 2 жыл бұрын
You need to use a database or save the stuff in some other way. I have tons of videos on that in the playlist
@bar___
@bar___ Жыл бұрын
So cool! I see this video is 6 months old, so the project is still pretty new, but has it gotten better during this time?
@Codemycom
@Codemycom Жыл бұрын
I assume not, but I haven't really checked. I figured I'd give it a year or so and check in then...
@CharlesStarbuck
@CharlesStarbuck 2 жыл бұрын
I think I see a python version of Electron in our future
@Codemycom
@Codemycom 2 жыл бұрын
:-p
@sinacoder
@sinacoder 2 жыл бұрын
How to use multiple programming languages ?
@Codemycom
@Codemycom 2 жыл бұрын
In what way?
@technoloop6960
@technoloop6960 Жыл бұрын
can we use tkinter in html? using pyscript
@Draglox
@Draglox Жыл бұрын
Tbf, what's the point
@heirofsam
@heirofsam Жыл бұрын
can we import wikipedia module?
@Codemycom
@Codemycom Жыл бұрын
You can do anything you can do with python, so yes.
@veillettejompheco7174
@veillettejompheco7174 Жыл бұрын
It's awesome but can we import package?
@Draglox
@Draglox Жыл бұрын
Yes I think
@cuong.thai93
@cuong.thai93 2 жыл бұрын
do you think it's the same as typescript
@Codemycom
@Codemycom 2 жыл бұрын
No
@chuang6248
@chuang6248 Жыл бұрын
I guess,When the page show in the browser ,Actually is the browser send the script to the server then server run the script return the result send to the browser.
@Codemycom
@Codemycom Жыл бұрын
No, that's how traditional python would work. There's no server here.
@rahulg8198
@rahulg8198 Жыл бұрын
how to run python tkinter file in browser
@Codemycom
@Codemycom Жыл бұрын
You can't.
@ddddami1
@ddddami1 2 жыл бұрын
Heyy John
@Codemycom
@Codemycom 2 жыл бұрын
Hello
@cbbcbb6803
@cbbcbb6803 2 жыл бұрын
Too bad we can't have something called "apls" or "any programing language script". Or maybe myols (makeup your own language script) for browsers. I have yet to find a language that I can love.
@Codemycom
@Codemycom 2 жыл бұрын
ha
@mjs28s
@mjs28s 2 жыл бұрын
So rather than coding your python in the HTML are you able to just import a python file into the HTML and run it that way, like when an HTML page has some JS attached to it? Unless we are talking about a small code block here and there I am not seeing the real need for it.
@Codemycom
@Codemycom 2 жыл бұрын
'Coding your python in the HTML'....uh, you can't code python in an HTML document. That's the entire point. With this, now you can. And no, there's nothing about importing a python file like a javascript file...why don't you just watch the video and see exactly what it is? lol
@84madara
@84madara 2 жыл бұрын
Disable browser cache
@dannyarcher6370
@dannyarcher6370 2 жыл бұрын
Is this WebAssembly based?
@Codemycom
@Codemycom 2 жыл бұрын
Don't think so...
@DevX_0o0
@DevX_0o0 2 жыл бұрын
PyScript is a framework that allows users to create rich Python applications in the browser using HTML's interface and the power of Pyodide, WASM, and modern web technologies.
@dannyarcher6370
@dannyarcher6370 2 жыл бұрын
@@DevX_0o0 Yeah, I checked it up after I asked and commented that here. For some reason YT thinks WASM is hate speech.
@karuchokikete7722
@karuchokikete7722 2 жыл бұрын
it won't crush js cause it needs js
@Codemycom
@Codemycom 2 жыл бұрын
But if people stop using javascript for this...yes it would crush javascript even though it uses javascript...
@lukemarkham6246
@lukemarkham6246 2 жыл бұрын
so really, adding another layer/facade on top of something to stop using said thing even though you need said thing to run the new layer
@Codemycom
@Codemycom 2 жыл бұрын
@@lukemarkham6246 lol "need the thing" you just point a reference to it. You don't have to write a single line of javascript...but you guys keep mincing words and arguing amongst yourselves lol
@AkbarovMuhammadali
@AkbarovMuhammadali 2 жыл бұрын
WE ARE WAITING. GOLANG COURSE
@Codemycom
@Codemycom 2 жыл бұрын
I have a Golang playlist, please don't yell.
@askarsaparov
@askarsaparov 2 жыл бұрын
Best
@Codemycom
@Codemycom 2 жыл бұрын
Thanks!
@oncoded
@oncoded Жыл бұрын
Say it with me...IT IS POSSIBLE, POSSIBLE.
@lecrowpus.
@lecrowpus. 2 жыл бұрын
When i started learning python i used to dream that i could write python in side html file in side script tag .lol naw u can
@Codemycom
@Codemycom 2 жыл бұрын
It really is awesome
@osiris5449
@osiris5449 2 жыл бұрын
15 times? learn, ctrl+shift+f5; maybe even ctrl+f5.
@Codemycom
@Codemycom 2 жыл бұрын
Yeah, that's what I did
@Python_in_UA
@Python_in_UA 2 жыл бұрын
+
@Codemycom
@Codemycom 2 жыл бұрын
++
@Avalanche034
@Avalanche034 2 жыл бұрын
Color me intriuged
@Codemycom
@Codemycom 2 жыл бұрын
Right?!
Chris Laffra - PyScript - Python in the browser
33:01
PyData
Рет қаралды 1,6 М.
Why did the angel disappear?#Short #Officer Rabbit #angel
00:38
兔子警官
Рет қаралды 6 МЛН
🌊Насколько Глубокий Океан ? #shorts
00:42
Sprinting with More and More Money
00:29
MrBeast
Рет қаралды 188 МЛН
Pyscript  - Should you Learn it?
15:15
Stefan Mischook
Рет қаралды 18 М.
Python In The Browser! PyScript First Look
21:34
Traversy Media
Рет қаралды 153 М.
Pyscript: Python In The Browser!
9:19
Jake Callahan
Рет қаралды 1,6 М.
How To Scrape (almost) ANY Website with Python
13:45
John Watson Rooney
Рет қаралды 37 М.
Start Automating Your Life Using Python! (File Management with Python Tutorial)
13:07
PyScript is officially here!🚀 Build web apps with Python & HTML
17:10
PyScript Demo / Tutorial | End-to-end PyScript Tutorial #1
28:01
Samuel Chan
Рет қаралды 37 М.
Why did the angel disappear?#Short #Officer Rabbit #angel
00:38
兔子警官
Рет қаралды 6 МЛН