IntroductionInstallationLimitations of the "file" protocolFrequently asked questionsSyntax, keywords and built-in functionsStandard distributionimport implementationBrython packagesBrowser interface
Introduction - DOM API
Creating a document Accessing elements Attributes, properties and methods Events Mouse events Keyboard events Focus events Drag events Query string Interactions with Javascript Brython-specific built-in modules
browser
browser.aio browser.ajax browser.html browser.local_storage browser.markdown browser.object_storage browser.session_storage browser.svg browser.template browser.timer browser.webcomponent browser.websocket browser.worker Widgets browser.widgets.dialog browser.widgets.menu interpreter javascript Working with BrythonCookbook |
interpreterThis module provides classes to open a Python interactive interpreter in a page. It is used by the console and the editor of the site brython.info.ClassesInterpreter(element=None, title="Interactive Interpreter", globals=None, locals=None, rows=30, cols=120, default_css=True)
from interpreter import Interpreter Interpreter() Inspector(title="Frames inspector", rows=30, cols=120, default_css=True)
Opens a dialog box with an interactive interpreter running in the program execution frames. This can be used for debugging purposes. Note that opening an inspector does not block program execution, but the namespaces used in the inspector represent the state of the frames when it was opened. For instance, in this example, the value of from interpreter import Inspector def f(x): y = 8 Inspector() y = 9 f(5) CSS styleIf an interpreter is opened in an existing DIV, the HTML stylesheet is used. Otherwise, if argument default_css isTrue (default), the following
stylesheet in inserted in the page:
To customize the interpreter look, pass.brython-interpreter { background-color: #000; color: #fff; font-family: consolas, courier; caret-color: #fff; overflow-y: auto; overflow-x: hidden; } @keyframes blinker { 50% { opacity: 0; } } pre{ display:inline; } default_css=False and redefine the
CSS class brython-interpreter . The most straightforward is to copy-paste
the stylesheet above and edit it.
|