Introduction

Installation

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

Cookbook

 

Problem

Make the browser display "Hello world !"

Solution

from browser import document
document <= "Hello world !"

document is a word defined in module browser that represents the document (the content of the web page). It supports the operation <= meaning "add content". Here the content is a simple Python string.