Remember, this is in Alpha, so it is very very new. It also will never replace JS. In my humble opinion, It will simply bring some great Python packages and tasks to the browser environment. Which I think is pretty damn cool. Anyone saying it will replace JS is fear-mongering or trying to get clicks.
console.log from inside a Py script took my breath away. Obviously the the ability to use Py packages in the browser is great but the bi-directional link between Py and JS to me is the most fascinating thing about this innovation.
Finally a video that clarifies pyscript. I think it's just the beginning but it could be bigger later on. But sure it doesn't replace JAVASCRIPT, let's not exaggerate. They are always two different things and I say this from Js-React dev, which is learning Python. They are both extraordinary
we'll see compiled languages more and more being adopted for frontend development. but python just isn't one of those. python requires loading a runtime + all your code, which is pretty bad. don't get me wrong there are some applications where having an embedded python runtime might be useful. but for general programming we'll see more and more people using other languages, some open source projects are already taking advantage of this: - Penpot uses Clojure; - Appflowy uses Rust; just to name a few. I'm honestly excited for javascript losing ground on the web space (more creativity and newer more correct and more secure languages on the web will be a huge plus, fragmentation will be a problem but it's something I'm willing to accept and it never bothered me since there has always been a lot of computer languages)
But if it compiles to webassembly it should actually be faster than JS no? (Although probably a larger download size) and if it has a fully featured DOM manipulation API then the only thing stopping it from replacing JS would be user adoption I would think. But then again, there are a bunch of JS frameworks that are faster than react and arguably better but that hasn't done too too much to slow down React's popularity.
@@PlasmaSnake369 No the only thing stopping it is the fact that every browser has a JS engine built in and it is extremely optimized at what it does for the browser
That's wicked, thanks for the small review video, I've got so many tools programmed in Python on so many machines, I already see some potential for moving a few of them online and accessing them via some neat user interface. I had no idea something like that existed, plus it looks super intuitive. So thanks for that :)
Funny, been learning JS for the past month or so. Just today decided to switch over for a bit to Python for various reasons...then I come across this video. How perfect a timing!
I started coding 6 years back had a job for 5 years they getting ready to fire me soon. I written a ton of different things for them and now I understand the true power of these programs after using them in real work examples. Anyways thanks and cheers to the futuree
This PyScript will be extremely helpful using with IoT. Simple project: You can have an Arduino/ESP32/Raspberry Pi, Python in the middle and PyScript on the Front-end and create really nice Dashboard, for instance.
This seems great! I have a question, about the practicality of it. Considering that the heavy computational operations that python would be doing, isn't that going to make any large scale website even more ram hungry? React + AI powered by Python sounds amazing, but the end user might disagree. I am just a junior, sorry if I'm missing something obvious.
I would assume for large dataset that it will utilize a good amount of memory, just like it would if you were running the script locally. As more ppl start testing this we will see what type of limitations there are. But I still think this is a great start for using Python on the front-end
I m realy excited to use python on the front end I was struggling with Js for months ,and finally python for the rescue .Thank you for sharing knowledge with the community.You earned +1 subscriber❤❤
7:15 omg finally, something actually useful. you're the only tutorial ive seen so far that has shown something more than describe how cool it is and use print().
trying to do the same thing you did at 12:07, however i keep getting this error; JsException(TypeError: Failed to fetch). Please help, i'm using a macbook.
seems like a nice shortcut to make a basic user interface in HTML/CSS/JS, and power some underlying processes with Python. certainly seems possible to be less annoying than fighting with Tkinter, Flask, or Django, though I haven't tried using PyScript like this, so I am just speculating.
I been waiting for something like py script for years. I love working with numpy and pandas and im very excited to make projects where I easily put that into the browser. Thanks for the awesome video :)
whats insane to think about is that you could do datascience stuff, and then have javascript frontend to output it. a big problem is trying to find a way to output cool datasci stuff in python to a format where javascript can take over. a lot of websites are gonna come out with some great datascience visualizations soon.
I don't even think it is comparable for basic front-end stuff. I think it will be used for Python-specific tasks in the browser. Stuff that you would not use JS for (Data Science, ML, etc)
it will never be as fast as javascript, you're shipping a python wasm interpreter with your code to run python. wasm itself is still slower than javascript for DOM manipulations, even once these have been fixed python will still be slower than javascript and by then most people will be using faster languages with wasm anyway (rust, haskell, c, go, kotlin, nim, etc)
Python is damn slow and has little to no advantages over JS, even more so if it runs on top of WASM instead of running natively. The only thing Python has over JS is operator overloading.
I am doing a project for college right now and I need to apply my dice game that I made with python to a web browser. So far it doesn't work, probably because its a game thats played using the terminal. I was wondering if I could get some pointers about how I could go about it? my game asks for user input which is the main issue im having trying to figure out with pyscript.
This is so cool! Wonder if it could also display data visualisations created in Python within the browser, imagine being able to display seaborn graph without having to learn an entirely new data vis. framework like d3.js to display data in front-ends.
Question. Is pyscript able to import any module if as long as i put it in a seperate .py file? For e.g Importing Requests module or importing sockets etc. Keep in mind i am also new to coding and i really like how Pyscript works.
Thanks for this Brad...How exciting! Plenty to explore. Any suggestions for a proper extension to get rid of all my underlined errors. Everything works great, but I just have these errors due to linting. Thanks again Brad!
well that would create much of a "new programming language" to me, since like the mix can be soo interesting and all, i would have a copy of the source and modify some things for a new file type (like pjs or pys for example) that would be really cool!! ALSO never forget typescript!!! :O, imagine if we also get a chance for that!!
This is incredible..! Can you train a model, pickle it and distribute the pickle through the web this way? This facilitates true distributed computing..!
just working directly with browser, it doesn't like file import - cors error on brave. but never the less thanks lmk how to get around this if you know.
how does this compare to brython? that's been a thing for a whiiiile, ALSO python in browser using webassembly... yet it's super obscure...which I'm not sure that this will have any bigger of an impact, if nobody's been using brython for like last 5 years, why would people use pyscript?
This is powerful, I once had to built separate APIs using Flask just so that I can use some of the python packages for ML applications. Tensorflow.js is there but it's not as nice. Great intro video, thank you!
Well its basically just webAssembly so all the vulnerabilitis of pyscript will be just webassembly vulnerabilitis. Pyscript is not a web standard or anything
brython is transpiler: it translate python source into javascript source and intrepret it in browser. pyscript using pyodide webassebly python distribution (all c code from cpython compiled into webasebly target) python code is interpreted directly in python interpreter running in browser webasebly enviroment.
Hello, thank you for the video. There was some problem with numpy - ModuleNotFoundError: No module named "numpy" even when the module was actually installed.
Remember, this is in Alpha, so it is very very new. It also will never replace JS. In my humble opinion, It will simply bring some great Python packages and tasks to the browser environment. Which I think is pretty damn cool. Anyone saying it will replace JS is fear-mongering or trying to get clicks.
Totally agree with you Brad, I wrote something like that in the comment. However JavaScript !== Python ✌🏻
Thanks for everything Brad! My life has been impacted for the better because of you!
Hey Brad, my fear is actually is thinking of how much I should know to be a complete web developer
Am glad to be one of the few ugandan students of brad traversy.... You have impacted my whole Mr Brad
Hope this comment will age well
The new intro is so modern and fire!!!
It's fine, but the old one carries so much with it that topping it seems impossible
@@harmitchhabra989 I miss the old one 😔.
console.log from inside a Py script took my breath away. Obviously the the ability to use Py packages in the browser is great but the bi-directional link between Py and JS to me is the most fascinating thing about this innovation.
Yeah, this is very cool.
same
Finally a video that clarifies pyscript. I think it's just the beginning but it could be bigger later on. But sure it doesn't replace JAVASCRIPT, let's not exaggerate. They are always two different things and I say this from Js-React dev, which is learning Python. They are both extraordinary
we'll see compiled languages more and more being adopted for frontend development. but python just isn't one of those. python requires loading a runtime + all your code, which is pretty bad. don't get me wrong there are some applications where having an embedded python runtime might be useful.
but for general programming we'll see more and more people using other languages, some open source projects are already taking advantage of this:
- Penpot uses Clojure;
- Appflowy uses Rust;
just to name a few. I'm honestly excited for javascript losing ground on the web space (more creativity and newer more correct and more secure languages on the web will be a huge plus, fragmentation will be a problem but it's something I'm willing to accept and it never bothered me since there has always been a lot of computer languages)
But if it compiles to webassembly it should actually be faster than JS no? (Although probably a larger download size) and if it has a fully featured DOM manipulation API then the only thing stopping it from replacing JS would be user adoption I would think. But then again, there are a bunch of JS frameworks that are faster than react and arguably better but that hasn't done too too much to slow down React's popularity.
@@PlasmaSnake369 No the only thing stopping it is the fact that every browser has a JS engine built in and it is extremely optimized at what it does for the browser
@@dhkatz_ Its optimized as well as is reasonable but same browser is built to run web assembly much faster
Can't wait to see a full course from you, when Pyscript is ready. Thanks very much
That's wicked, thanks for the small review video, I've got so many tools programmed in Python on so many machines, I already see some potential for moving a few of them online and accessing them via some neat user interface. I had no idea something like that existed, plus it looks super intuitive. So thanks for that :)
Funny, been learning JS for the past month or so. Just today decided to switch over for a bit to Python for various reasons...then I come across this video. How perfect a timing!
I can already see myself invested in this and creating something as I love python. Thanks for the video!
I work on web app using Python, Django and Flask, I'm loving this a lot. I will must definitely be playing around with this
@@codingwithlu yes, I believe compared to Django we are going to get much more flexibility and we can implement complex things with this.
very nice. as a web dev and a slytherin, i really love the idea of adding Python to my applications.
Wow that was incredible! 🤯 The ability to use Python packages in the browser!!! That's huge 💯
Thanks for putting this video together Brad 👍🏻
Couldn't agree more
Thank you so much for making this video. You saved me from getting a low c on my final project.
I started coding 6 years back had a job for 5 years they getting ready to fire me soon. I written a ton of different things for them and now I understand the true power of these programs after using them in real work examples. Anyways thanks and cheers to the futuree
Kjo është videoja më e mirë ndonjëherë
This PyScript will be extremely helpful using with IoT. Simple project: You can have an Arduino/ESP32/Raspberry Pi, Python in the middle and PyScript on the Front-end and create really nice Dashboard, for instance.
Thats cool I bet you can make python and JS interoperate using the dom as a messaging service
Finally good video about Pyscript! Thanks 👏👏👏👏
This seems great! I have a question, about the practicality of it. Considering that the heavy computational operations that python would be doing, isn't that going to make any large scale website even more ram hungry? React + AI powered by Python sounds amazing, but the end user might disagree. I am just a junior, sorry if I'm missing something obvious.
I would assume for large dataset that it will utilize a good amount of memory, just like it would if you were running the script locally. As more ppl start testing this we will see what type of limitations there are. But I still think this is a great start for using Python on the front-end
I m realy excited to use python on the front end I was struggling with Js for months ,and finally python for the rescue .Thank you for sharing knowledge with the community.You earned +1 subscriber❤❤
Keep practicing, I'm sure you'll get the hang of JS eventually
A bit confusing that the python print function doesn't output on console imo
I see what you did there :)
@@akshaypendyala ?
@@darshandev1754 I honestly forgot why I wrote that 😂😂😂
@@akshaypendyala 😂
7:15 omg finally, something actually useful. you're the only tutorial ive seen so far that has shown something more than describe how cool it is and use print().
As a Python developer... this is wild!
trying to do the same thing you did at 12:07, however i keep getting this error; JsException(TypeError: Failed to fetch). Please help, i'm using a macbook.
Thank you as always Brad! 👏🏽👏🏽👏🏽
The most beautiful Frankenstein monster I've ever seen! this is awesome though ngl
Just waited for your explanation as usual. It helped to learned a lot from this single video than prevous 2-3 days. Thanks man.
20:35 really hit the frontend developers's thought!
I see this as a huge oportunity to run ai in the browser, like tensor flow, keras. Really looking forward to check this one out
A real "Finally, it's here" video
reinventing the wheel in this industry never ends -.-
seems like a nice shortcut to make a basic user interface in HTML/CSS/JS, and power some underlying processes with Python. certainly seems possible to be less annoying than fighting with Tkinter, Flask, or Django, though I haven't tried using PyScript like this, so I am just speculating.
I been waiting for something like py script for years. I love working with numpy and pandas and im very excited to make projects where I easily put that into the browser.
Thanks for the awesome video :)
This is crazy! Wow! Already love it.
Gota love Web Assembly - Thanks Brad!
Great intro! This is a big step forward imho
whats insane to think about is that you could do datascience stuff, and then have javascript frontend to output it. a big problem is trying to find a way to output cool datasci stuff in python to a format where javascript can take over. a lot of websites are gonna come out with some great datascience visualizations soon.
What editor are you using?
the project is good but it will take time for it to be as fast and reliant as javascript
I don't even think it is comparable for basic front-end stuff. I think it will be used for Python-specific tasks in the browser. Stuff that you would not use JS for (Data Science, ML, etc)
@@TraversyMedia Yeah excellent point, what's the point of creating another JavaScript anyway?
It will never be as fast. Only JS can access the dom. This is jet another wrapper around js + wasm modules for the language logic.
it will never be as fast as javascript, you're shipping a python wasm interpreter with your code to run python. wasm itself is still slower than javascript for DOM manipulations, even once these have been fixed python will still be slower than javascript and by then most people will be using faster languages with wasm anyway (rust, haskell, c, go, kotlin, nim, etc)
Python is damn slow and has little to no advantages over JS, even more so if it runs on top of WASM instead of running natively. The only thing Python has over JS is operator overloading.
I am doing a project for college right now and I need to apply my dice game that I made with python to a web browser. So far it doesn't work, probably because its a game thats played using the terminal. I was wondering if I could get some pointers about how I could go about it? my game asks for user input which is the main issue im having trying to figure out with pyscript.
Great demo❤
I wonder if you could then package it using electron, as an alternative to tkinter and all that faff for simple GUI apps.
This is next generation. .really cool
This is so cool! Wonder if it could also display data visualisations created in Python within the browser, imagine being able to display seaborn graph without having to learn an entirely new data vis. framework like d3.js to display data in front-ends.
I was hoping I could use PyScript with tkinter, but no apparently.
Helpline 📲📩
QUESTIONS CAN COME IN☝️⬆️ ⬆️......
I think you can still use to parse/manipulate the dom tree, using Beatufulsoup
very good introduction
Ooh I like the new intro! :)
This is great, thanks for posting this video!
Question. Is pyscript able to import any module if as long as i put it in a seperate .py file? For e.g Importing Requests module or importing sockets etc. Keep in mind i am also new to coding and i really like how Pyscript works.
Great and concise as always!
Man, you are just insanely fast with new tech, whatever it is. How?
Thanks you sir for good work. It will be a privilege to meet you one on one
I'm no expert in python but can I used Pip packages ? or how will I know the available packages that I can use, example beautifulsoup ?
Me: Starts learning HTML, CSS, and JavaScript so I can make websites
Traversy: Hold my PyScript
are we going to web assembly with this?
Very interesting video Brad! 👍🏻🤙🏻
Thanks for this Brad...How exciting! Plenty to explore. Any suggestions for a proper extension to get rid of all my underlined errors. Everything works great, but I just have these errors due to linting. Thanks again Brad!
Hello Mr.brad I have a question
how i can use the pyscript tag locally?
What VSC theme are you using?
Is that possible to access the file systems from browser using this? Also all the file operations like create, read, write, delete.
No, websites are run in a virtual machine and dont have acces to local computer’s filesystem
Would it work in Angular?
please explanin this..What langauge we learn from today,what is the best javascript or pyscript
well that would create much of a "new programming language" to me, since like the mix can be soo interesting and all, i would have a copy of the source and modify some things for a new file type (like pjs or pys for example) that would be really cool!!
ALSO never forget typescript!!! :O, imagine if we also get a chance for that!!
would love to call python libraries like this on backend node server too
I could see a use for this in basic authentication for new backend developers
This is incredible..! Can you train a model, pickle it and distribute the pickle through the web this way? This facilitates true distributed computing..!
Waiting for PyScript frameworks😃
00:49 Numpy not Num-Pee
This is exciting!
just working directly with browser, it doesn't like file import - cors error on brave. but never the less thanks lmk how to get around this if you know.
how does this compare to brython?
that's been a thing for a whiiiile, ALSO python in browser using webassembly...
yet it's super obscure...which I'm not sure that this will have any bigger of an impact, if nobody's been using brython for like last 5 years, why would people use pyscript?
I think it's making slow our Web page. You just wrote free lines of on which it was loading for free second.
This is thrilling!!!
Just some more crazy stuff has come. Web-D is becoming more intresting now.
Thanks Brad.
Can we have REPL tag that has some content prefilled?
Helpline 📲📩
QUESTIONS CAN COME IN☝️⬆️ ⬆️....
me watching this video:
"Oh, that's cool"
"Wait, whaaat?"
"OMG, that is siiiick"
Htmx is also so cool and revolutionary.
This is powerful, I once had to built separate APIs using Flask just so that I can use some of the python packages for ML applications. Tensorflow.js is there but it's not as nice. Great intro video, thank you!
This vid is good and very educational for me! thanks.
MashaaAllah Aameen 🙏 😍 🤲
Take love from Bangladesh
i want to design Ripl with Css? how can i be?
Exactly in what way will it never replace JS?
Cant wait to try this out
What is the likelihood of PyScript being identified as an additional security vulnerability for browsers?
Well its basically just webAssembly so all the vulnerabilitis of pyscript will be just webassembly vulnerabilitis. Pyscript is not a web standard or anything
it depends
security is more on backend than frontend
servers has 0 trust on clients so dont worry
basically, a Blazor alternative that was created a long time ago.
What is that little yellow icon at the bottom right??
Copilot icon
@@mauricionarvel8945 Thought so..
Long way from this being actually useful but still a great step
So how does this compare to Brython?
brython is transpiler: it translate python source into javascript source and intrepret it in browser.
pyscript using pyodide webassebly python distribution (all c code from cpython compiled into webasebly target) python code is interpreted directly in python interpreter running in browser webasebly enviroment.
@@kacoufal ah i see. Thank you 👍
Hello, thank you for the video. There was some problem with numpy - ModuleNotFoundError: No module named "numpy" even when the module was actually installed.
Had the same issue. Try this in the head (note even if it's just one package it needs the square brackets):
packages = ['numpy']
@@BarcalonaFTW90 Thanks man.
How does PyScript works with minifying and obfuscation ?
would this be possibile on webflow?
I'm the first to watch it and comment. Uraaa!))
Can i do image processing? With PIL
Javascript ❤ always stay never expire
Make space for King, his tutorial is here
what is the browser he uses?
NumPee!
As I understand it's interpretation of the phyton language in JS
Interesting and starting of something big maybe. Nobody knows :)