{
  "id": "enwiki-001371681643",
  "slug": "pyscript",
  "title": "PyScript",
  "qid": "",
  "lead": "PyScript is a framework for running Python scripts in a web browser. PyScript was presented to the public by Peter Wang at a Python developer conference in June 2022. PyScript is primarily developed by Anaconda, Inc.",
  "body": "PyScript is a framework for running Python scripts in a web browser. PyScript was presented to the public by Peter Wang at a Python developer conference in June 2022. PyScript is primarily developed by Anaconda, Inc. PyScript: What time is it? What time is it? from pyscript import when, display from datetime import datetime @when(\"click\", \"#btnTime\") def click_handler(event): now = datetime.now() display( now.strftime( \"Today is %m/%d/%Y. \" + \"The current time is %I:%M:%S %p.\" ) ) As an alternative to , the element can also be used (as in the example below). However, the new notation is recommended. PyScript also offers the possibility to communicate with the user via a command prompt. For this, the terminal attribute must be added to the or element. If input should also be possible, the worker attribute must be specified as well. In earlier versions, a terminal could also be implemented using the element. PyScript: Bar chart packages = [\"matplotlib\"] import matplotlib.pyplot as plt from pyscript import display fig, ax = plt.subplots() x = [\"Apples\", \"Pears\", \"Bananas\", \"Pineapples\"] y = [3, 7, 8, 10] plt.bar(x, y) plt.xlabel('Fruits') plt.ylabel('Popularity') plt.title('Fruits and their popularity') fig display(fig, target=\"mpl\") In order to create such diagrams, the matplotlib extension must be loaded in a block.",
  "categories": [
    "24165216",
    "32047518",
    "33243125",
    "63697623"
  ],
  "license": "CC BY-SA 4.0",
  "source_uri": "https://en.wikipedia.org/w/index.php?oldid=1371681643",
  "content_hash": "",
  "created_at": null,
  "updated_at": 1787857792.0,
  "claims": [],
  "contradictions": [],
  "confidence": 0.6,
  "csl": {
    "id": "enwiki-001371681643",
    "type": "webpage",
    "title": "PyScript",
    "author": [
      {
        "family": "Anticloud FZ LLE",
        "literal": "Anticloud FZ LLE"
      }
    ],
    "container-title": "encyclopegia.org",
    "publisher": "Anticloud FZ LLE",
    "publisher-place": "Dubai, United Arab Emirates",
    "URL": "https://encyclopegia.org/a/pyscript",
    "issued": {
      "date-parts": [
        [
          2026,
          11,
          18
        ]
      ]
    },
    "accessed": {
      "date-parts": [
        [
          2026,
          11,
          18
        ]
      ]
    },
    "license": "CC BY-SA 4.0",
    "DOI": "eo1:enwiki-001371681643",
    "isBasedOn": "https://en.wikipedia.org/w/index.php?oldid=1371681643",
    "note": "Immutable snapshot enwiki-001371681643"
  }
}