Subscript

A set of Python wrapped JavaScript libraries built with py2js
Download

Subscript Ranking & Summary

Advertisement

  • Rating:
  • License:
  • AGPL v3
  • Publisher Name:
  • Amirouche Boubekki
  • Publisher web site:
  • http://bitbucket.org/abki/

Subscript Tags


Subscript Description

A set of Python wrapped JavaScript libraries built with py2js Subscript is a set of Python wrapped JavaScript libraries built with py2js that let you play with the browser, easly prototyping application in your favorite language.The Python package that makes py2js available in your environment.Everything you need from javascript is bundled in subscript.src.js.Wrapped libraries- qwery, a compact css querier- domready , let's you know when the dom is ready- bonzo, library agnostic, extensible DOM utility- MinPubSub, 198 byte publish/subscribe messaging micro-framework- reqwest, a robust lightweight wrapper for asynchronous http requests- morpheus a brilliant animatorGetting startedStart to download subscript.src.js and installing Subscript with your favorite tool.With these in hands, you will have access in your Python files, built with py2js, the functions and classes that are part of Subscript API plus py2js function js and every object made visible by the browser document, window and the like (if any).This is valid Subscript Python code:def dom_ready(): log('Hello from Python')Put this in hello.py, run py2js hello.py > hello.js it will generate a hello.py.js file. To test it, copy and paste following code in hello.html file:< html >< head > < meta http-equiv="Content-Type" content="text/html; charset=utf-8" > < script type="text/javascript" src="subscript.src.js" >< /script > < title id="page-title" >Hello< /title >< /head >< body >< script type="text/javascript" src="hello.js" >< /script >< script type="text/javascript" > bonzo.setQueryEngine(qwery); domReady(function () { dom_ready(); });< /script >< /body >< /html >Run this in a browser, a message should show up in your JavaScript console. Requirements: · Python


Subscript Related Software