OLV Basiliek Zwolle

Main Menu

  • Home
  • Browser list
  • Browser software
  • Browser types
  • Browser news

OLV Basiliek Zwolle

Header Banner

OLV Basiliek Zwolle

  • Home
  • Browser list
  • Browser software
  • Browser types
  • Browser news
Browser types
Home›Browser types›PyScript: Python in the web browser

PyScript: Python in the web browser

By Ronnie A. Huntsman
June 9, 2022
0
0

A chainsaw can do a short job of clearing the back forty. It can also make a good horror movie. So while some people will say that we don’t need another tool to allow more malicious scripts into the browser, we also know that like any tool, you can use it or abuse it. This tool ? Pythonwhich is, of course, Python in the browser.

The tool is in the early experimental phase, so the project does not yet suggest using it in a production environment. However, if it works well, the promise isn’t just that you can write browser-based applications in Python – you’ll have a convenient way to reuse existing Python code and even be able to run the same code on the browser that is currently running. on the server. This has many implications for enhanced client/server applications, or cases where you want to be able to run on a local backend when disconnected and on a remote backend when you have a connection. Of course, you can also interact with JavaScript.

However, the real goal is to make web programming accessible to beginners in the same way that programming systems like Scratch or JSFiddle do. As such, the actual project is less software than an integration between existing elements. According to the post:

PyScript is a Single Page Application (SPA) written in TypeScript using the Svelte framework, styled with Tailwind CSS, and bundled with rollup.js.

PyScript wouldn’t be possible without relying on a recent version of Pyodide, a compiled CPython interpreter with emscripten for WebAssembly, allowing Python to run in the browser. PyScript provides a thin layer of abstraction over Pyodide by encapsulating the required boilerplate code that you would otherwise have to type in yourself using JavaScript.

So how hard is it to create PyScript code? Not very:






Hello, World!





print("Hello, World!")


What is interesting is that it does not require any server configuration. Save this text to a file, open it in a browser and it runs. Well, of course, no server configuration for you. Presumably, the work is done on the pyscript.net server which takes a lot of configuration! There’s also a bit of a load time for something so simple, as you’d expect, especially on the first load. However, you can host your own server.

Some people will love it, and some people will hate it. Anyway, it’s here, and if you have to script in the browser, you could do worse than Python. We still hang on to Fortran, though maybe we should switch to Forth.

Categories

  • Browser list
  • Browser news
  • Browser software
  • Browser types

Recent Posts

  • Secret Mode: Huawei Browser vs. Samsung Internet
  • Beagle Button: Could this browser extension help you save money?
  • 7 must-see space websites that will change your perception of the cosmos
  • Browser Games Market Size Research Reports and Industry Analysis | Alien Hominid, Bejeweled, Meat Boy – Indian Defense News
  • Attackers can use “Scroll to Text Fragment” web browser feature to steal data – research

Archives

  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • Privacy Policy
  • Terms and Conditions