Cyber Security News

PyScript Let Users to Run Python Programs in the Browser

The Founder of Anaconda, Peter Wang revealed a new project “PyScript” at PyCon US 2022. Specifically, this project facilitates Python to take a serious step towards making programming and data science more accessible to everyone.

“PyScript is a framework that allows users to create rich Python applications in the browser using a mix of Python with standard HTML. It aims to give users a first-class programming language that has consistent styling rules, is more expressive, and is easier to learn”, reads the blog post published by Anaconda.

The Core Components of PyScript:

PyScript is just HTML, more powerful that includes a rich and accessible ecosystem of Python libraries. The key components include:

  • Facilitate drop-in content, external file hosting (via Pyodide project)
  • Allows using Python and its vast ecosystem of libraries (including numpy, pandas, scikit-learn) from within the browser.
  • Bi-directional communication between Python and Javascript objects and namespaces.
  • Environment management helps users to decide which packages and files to include for the page code to run.
  • Allows creating curated UI components, such as buttons, containers, and more.
  • Flexible framework to create and share newly pluggable and extensible components directly in Python.

Therefore, PyScript offers a clean and simple API, supports standard HTML, extends HTML to read custom components that are opinionated and reliable, and also provides a pluggable and extensible components system.

Working with PyScript:

To try PyScript, import the appropriate pyscript files to your html page with:

<link rel=”stylesheet” href=”https://pyscript.net/alpha/pyscript.css” />

<script defer src=”https://pyscript.net/alpha/pyscript.js”></script>

  • <py-script>: Used to define python code that is executable within the web page. The element itself is not rendered to the page and only used to add logic.
  • <py-repl>: Creates a REPL component that is rendered to the page as a code editor and allows users to write code that can be executed.

Therefore, PyScript supports writing and running Python code in a browser. The objective for the future is that it will also provide support for other languages.

You can follow us on LinkedinTwitterFacebook for daily Cybersecurity and hacking news updates.

Guru Baran

Gurubaran is a co-founder of Cyber Security News and GBHackers On Security. He has 10+ years of experience as a Security Consultant, Editor, and Analyst in cybersecurity, technology, and communications.

Recent Posts

Chrome High-severity Vulnerabilities Let Attackers Access Sensitive Data and Crash System

Google has issued an urgent security update for its Chrome web browser to address three…

49 minutes ago

Threat Actors Breaking to Enterprise Infrastructure Within 18 Minutes From Initial Access

Cybersecurity professionals are facing an unprecedented acceleration in threat actor capabilities as the average breakout…

3 hours ago

New Malware in npm Package Steals Browser Passwords Using Steganographic QR Code

A sophisticated malware campaign has emerged in the npm ecosystem, utilizing an innovative steganographic technique…

3 hours ago

Zloader Malware Repurposed to Act as Entry Point Into Corporate Environments to Deploy Ransomware

Zloader, a sophisticated Zeus-based modular trojan that first emerged in 2015, has undergone a significant…

4 hours ago

Beware of Fake Online Speedtest Application With Obfuscated JS Codes

A sophisticated malware campaign has emerged that leverages fake online speed test applications to deploy…

8 hours ago

Defy Security Appoints Esteemed Cybersecurity Leader Gary Warzala to Its Board of Directors

Defy Security, a leading provider of cybersecurity solutions and services, today announced the appointment of…

10 hours ago