Frequently asked questions

Syntax, keywords and built-in functions

Standard distribution

import implementation

Browser interface

Brython-specific built-in modules

Working with Brython

Brython for Firefox OS



Creating a document

Brython is made to program web applications, thus HTML pages that the user can interact with

A page is made of elements (texts, images, sounds...) that can be included in the page in two different ways :

  • writing HTML code with tags, for instance

<b>Brython</b> is an implementation of <a href="">Python</a>
for web browsers

  • or writing Python code, using the built-in module browser.html

<script type="text/python">
from browser import document
from browser.html import A,B

document <= B("Brython")+"is an implementation of "
document <= A("Python",href="")+" for web browsers"