PyScript – Running python in your browser​

Veröffentlicht am: 20 Mai 2022
auf dem Kanal: DigitalSreeni
5,009
154

Tips and Tricks 36:

Code from this video is available at:
https://github.com/bnsreenu/python_fo...

Useful resources:
https://pyscript.net/
https://github.com/pyscript/pyscript

If we want to load an external python file as a module into the html file, the best way would be to start a local webserver.

If the html file is located at /my_dir/my_file.html
if you just open the my_file.html in a browser, it will not recognize other files referenced.

You need to start a local webserver.

Open the command prompt (or conda prompt) - wherever you can just type python to execute python commands.
Now type: python -m http.server (or python3 - depending on how you access your local python)

This should start a webserver. Now just go to the browser and type: http://localhost:8000/
You should see a list of files in that local directory. Now, click the html file.


Auf dieser Seite können Sie das Online-Video PyScript – Running python in your browser​ mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer DigitalSreeni 20 Mai 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 5,009 Mal angesehen und es wurde von 154 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!