Opportunities and Limitations of Running Python Code in the Web Browser
收藏资源简介:
Python is a popular programming language that is widely used for a variety of applications such as web development, data analysis, scientific computing, and education. This versatility makes it a popular choice for developers and educators who need a language that can be used for a wide variety of tasks. While Python is typically run on the server side or on the desktop, there is a growing interest in running Python code directly on the client side, i.e., in the browser. There are several possibilities available for running Python code in the browser, among others, transpiling it into JavaScript (cf. e.g., Transcrypt), running it by making use of an interpreter implemented in JavaScript (cf. e.g., Brython or Skulpt), or executed it by leveraging a Python interpreter compiled to WebAssembly (cf. e.g., Pyodide or CoWasm), an open standard defined by the World Wide Web Consortium specifying a bytecode for running programs in browsers. Since the choice of the right tool for a given application depends on the specific requirements and constraints, the aim of this bachelor thesis is to provide an overview of the state of the art in running Python code in the browser. This is done by presenting a variety of different tools and environments available, their capabilities and limitations, as well as some application examples and sample code. Furthermore, similar to Kiyokawa’s & Jin’s (2022) work on “A Front-End Framework Selection Assistance System [...]”, the objective of this bachelor’s thesis is to develop criteria to help developers and educators in the selection process. Link to Respository: https://git.uibk.ac.at/csav4362/running-python-in-web-browser
Python是一门广受欢迎的编程语言,被广泛应用于Web开发、数据分析、科学计算与教育等诸多领域。这种多用途特性使其成为开发者与教育工作者的热门选择,因其需要一门可适配多样任务的编程语言。尽管Python通常运行于服务器端或桌面环境,但如今直接在客户端(即浏览器中)运行Python代码的需求正日益增长。目前已有多种可在浏览器中运行Python代码的方案:例如将其转译为JavaScript(参见Transcrypt)、借助JavaScript实现的解释器运行代码(参见Brython或Skulpt),或是通过调用编译为WebAssembly的Python解释器执行代码(参见Pyodide或CoWasm)。WebAssembly是万维网联盟(World Wide Web Consortium)定义的一项开放标准,用于为浏览器中的程序运行提供字节码规范。由于针对特定应用选择合适工具时需结合具体需求与约束条件,本学士学位论文的目标是综述当前在浏览器中运行Python代码的技术前沿现状。为此,本文将介绍多款可用的工具与运行环境,分析其功能特性与局限性,并辅以若干应用案例与示例代码。此外,参考Kiyokawa与Jin(2022)在《前端框架选择辅助系统[...]》中的研究工作,本学士学位论文还旨在构建一套选型标准,以助力开发者与教育工作者完成工具选型流程。仓库链接:https://git.uibk.ac.at/csav4362/running-python-in-web-browser



