Security, software development and devops in a cloud world - AWS, Azure, Google, IBM & Alibaba

Category Python

PyScript: Interfacing with WASM

PyScript is possible because of WASM. I wanted to see what is involved in calling functions located in a WASM module from Python. Turns out it is very easy to do at least at the function import and export level…. Continue Reading →

PyScript: Debugging and Error Management Strategies

Knowing that an error occurred is the first step to preventing and solving errors. There are many types of errors that PyScript applications will experience. Network failures, resources not being available and programming mistakes are just a few problems to… Continue Reading →

PyScript: Creating Installable Offline Applications

PyScript PWA Creating installable PyScript applications that cache assets and runs offline offer enormous potential for Python. In this article, I will show you how to create a Python application that installs on the desktop and on mobile devices. This… Continue Reading →

PyScript – Getting Application Data

In PyScript, as well as JavaScript, there are only a few methods of getting data into your program: Read data from the local file system Read data from the network Input data from the user Create data inside your application… Continue Reading →

PyScript: Third Party Criticism of PyScript

A recent article by Luciano Abriata criticized PyScript. He made two statements: Pyscript is way too slow and heavy to load. Does not support all of Python’s features and libraries. He then provided two example programs link and link. The… Continue Reading →

Pyscript: Files and File Systems – Part 2

In this article, I will show how to use the File System Access API. This API is a web platform API that enables developers to build powerful web apps that interact with files on the user’s local device. There are… Continue Reading →

Pyscript: Building from Source

This article discusses downloading and building PyScript from the source for Ubuntu 20.04 running within Windows WSL. For Linux, skip over the first section covering WSL setup. This article is written for the Python developer with limited experience building JavaScript/Node.js… Continue Reading →

PyScript: Good Videos to Watch

As momentum builds for PyScript, a few good resources are being created. This article is my attempt to keep track of the ones that are very good and/or have detailed knowledge. Please let me know if you know of one… Continue Reading →

Pyscript: Files and File Systems – Part 1

This will be the first of several articles that provides details on Pyscript files and file systems. I will discuss the different virtual file systems and how to access files located on the desktop. I have put each example in… Continue Reading →

Pyscript: Graphics

Introduction If you are familiar with using the Canvas with JavaScript, then you will quickly know how to draw on the Canvas with Python knowing a couple of minor items. If you are a Python developer new to drawing inside… Continue Reading →

PyScript: Create the py-script tag at Runtime

Introduction There are times that you want to write pure HTML and JavaScript code and during runtime download and execute Python code based upon various criteria. This article shows how to create the <py-script> tag, load code into the py-script… Continue Reading →

Pyscript: JavaScript Event Callbacks

Introduction Setting up Python event handlers in Pyscript requires special handling. Pyodide provides a proxy so that DOM events can use Python functions as callbacks. To create a proxy, call the pyodide.create_proxy() function [link].

The Python function myFunction is… Continue Reading →

Pyscript: Page Load Time

Introduction I have noticed an interesting anomaly between Pyodide and Pyscript. Pyscript takes about one second longer to load an HTML + Python page than Pyodide. Pyodide averages 2 seconds and Pyscript 3 seconds. Other interesting stats: Downloads: Pyodide downloads… Continue Reading →

PyScript: JavaScript and Python Interoperability

Introduction Pyscript/Pyodide supports excellent interoperability between JavaScript and Python. Python can call JavaScript and JavaScript can call Python. DOM events can use Python functions as callbacks. This article covers Python calling JavaScript functions and how to pass and receive data… Continue Reading →

PyScript: Loading Python Code in the Browser

Introduction Today, you can now use Pyscript to run Python code in the web browser. This has enormous potential for AI, ML, Data Scientists, and regular Python developers. I often develop backend applications in Django and Flask, and the possibilities… Continue Reading →

Azure – Setting up a Development Environment for Python

Introduction This article demonstrates how to set up a Windows development system with Python and the Azure SDK for Python. After my article, Azure – Lock a VM to Prevent Deletion, I wrote the Azure CLI equivalent commands in Python…. Continue Reading →

© 2022 John Hanley — Powered by WordPress

Theme by Anders NorenUp ↑