Introduction

Installation

Limitations du protocole "file"

Questions fréquemment posées

Syntaxe, mots-clés et fonctions intégrées

Distribution standard

Implémentation de import

Packages Brython

Interface avec le navigateur

Introduction - API DOM
Créer un document
Accéder aux éléments
Attributs, propriétés et méthodes

Evénements
Evénements souris
Evénements clavier
Evénements focus
Evénements pour glisser-déposer

Chaine de requête

Objets et librairies Javascript

Modules intégrés propres à Brython

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

Travailler avec Brython

Options de la fonction brython()
Test et débogage
Deployer une application

Recettes

Salut !
Insérer du contenu dans un élément
Mise en forme HTML (gras, italique...)
Table HTML
Attacher / détacher des événements
Gérer la sélection d'options dans un SELECT
Glisser-déposer
Obtenir le contenu d'un élément
Lire le contenu d'un fichier
Stocker des objets localement
Exemple de onmouseover
 

Comparaison des distributions Brython et CPython 3.10

Répertoire Fichiers communs aux deux distributions
* indique que la version Brython est différente de CPython
Remplacement de modules CPython Spécifiques à Brython Dans CPython mais pas (encore) dans Brython
*: remplacé par un module Javascript dans /libs
Lib *_collections_abc.py
_compat_pickle.py
_compression.py
_markupbase.py
_pydecimal.py
_py_abc.py
_threading_local.py
_weakrefset.py
__future__.py
abc.py
antigravity.py
*argparse.py
ast.py
base64.py
bdb.py
bisect.py
calendar.py
cmd.py
code.py
codecs.py
codeop.py
colorsys.py
configparser.py
contextlib.py
contextvars.py
copy.py
copyreg.py
csv.py
*dataclasses.py
datetime.py
decimal.py
*difflib.py
doctest.py
*enum.py
fnmatch.py
fractions.py
*functools.py
genericpath.py
getopt.py
getpass.py
gettext.py
glob.py
gzip.py
heapq.py
hmac.py
imp.py
inspect.py
io.py
ipaddress.py
keyword.py
linecache.py
locale.py
mimetypes.py
nntplib.py
ntpath.py
numbers.py
opcode.py
operator.py
optparse.py
*os.py
pathlib.py
pdb.py
pickle.py
pkgutil.py
*platform.py
posixpath.py
pprint.py
profile.py
pydoc.py
py_compile.py
queue.py
quopri.py
*re.py
reprlib.py
selectors.py
shlex.py
*shutil.py
signal.py
site.py
socket.py
sre_compile.py
sre_constants.py
sre_parse.py
stat.py
statistics.py
string.py
stringprep.py
struct.py
subprocess.py
symtable.py
*sysconfig.py
tabnanny.py
tarfile.py
tempfile.py
textwrap.py
this.py
threading.py
timeit.py
token.py
tokenize.py
*traceback.py
*turtle.py
types.py
*typing.py
uu.py
uuid.py
warnings.py
weakref.py
*webbrowser.py
zipfile.py
zipimport.py
_codecs.py (built-in)
_codecs_jp.py (built-in)
_collections.py (built-in)
_contextvars.py (built-in)
_csv.py (built-in)
_frozen_importlib.py (\lib\importlib\_bootstrap.py)
_functools.py (built-in)
_imp.py (built-in)
_io.py (built-in)
_multibytecodec.py (built-in)
_operator.py (built-in)
_queue.py (\DLLs\_queue.pyd)
_random.py (built-in)
_signal.py (built-in)
_socket.py (\DLLs\_socket.pyd)
_sre.py (built-in)
_struct.py (built-in)
_testcapi.py (\DLLs\_testcapi.pyd)
_thread.py (built-in)
_weakref.py (built-in)
atexit.py (built-in)
binascii.py (built-in)
cmath.py (built-in)
errno.py (built-in)
faulthandler.py (built-in)
gc.py (built-in)
itertools.py (built-in)
select.py (\DLLs\select.pyd)
sys.py (built-in)
time.py (built-in)
zlib.py (built-in)
_dummy_thread.py
_sysconfigdata.py
_sysconfigdata_0_brython_.py
external_import.py
formatter.py
interpreter.py
pwd.py
re1.py
tb.py
VFS_import.py
aifc.py
asynchat.py
asyncore.py
binhex.py
bz2.py
cgi.py
cgitb.py
chunk.py
compileall.py
cProfile.py
crypt.py
*dis.py
filecmp.py
fileinput.py
ftplib.py
graphlib.py
*hashlib.py
imaplib.py
imghdr.py
lzma.py
mailbox.py
mailcap.py
*modulefinder.py
netrc.py
nturl2path.py
pickletools.py
pipes.py
plistlib.py
poplib.py
pstats.py
pty.py
pyclbr.py
*random.py
rlcompleter.py
runpy.py
sched.py
secrets.py
shelve.py
smtpd.py
smtplib.py
sndhdr.py
socketserver.py
ssl.py
sunau.py
telnetlib.py
trace.py
tracemalloc.py
tty.py
wave.py
xdrlib.py
zipapp.py
_aix_support.py
_bootsubprocess.py
_osx_support.py
_pyio.py
_sitebuiltins.py
*_strptime.py
__phello__.foo.py
Lib\browser aio.py
ajax.py
highlight.py
idbcache.py
indexed_db.py
local_storage.py
markdown.py
object_storage.py
session_storage.py
svg.py
template.py
timer.py
ui.py
webcomponent.py
websocket.py
worker.py
Lib\browser\widgets __init__.py
dialog.py
menu.py
Lib\collections __init__.py
abc.py
Lib\concurrent __init__.py
Lib\concurrent\futures _base.py
__init__.py
process.py
thread.py
webworker.py
Lib\email _encoded_words.py
_header_value_parser.py
_parseaddr.py
_policybase.py
__init__.py
architecture.rst
base64mime.py
charset.py
contentmanager.py
encoders.py
errors.py
feedparser.py
generator.py
header.py
headerregistry.py
iterators.py
message.py
parser.py
policy.py
quoprimime.py
utils.py
Lib\email\mime __init__.py
application.py
audio.py
base.py
image.py
message.py
multipart.py
nonmultipart.py
text.py
Lib\encodings __init__.py
aliases.py
ascii.py
base64_codec.py
big5.py
big5hkscs.py
bz2_codec.py
charmap.py
cp037.py
cp1006.py
cp1026.py
cp1125.py
cp1140.py
cp1250.py
cp1251.py
cp1252.py
cp1253.py
cp1254.py
cp1255.py
cp1256.py
cp1257.py
cp1258.py
cp273.py
cp424.py
cp437.py
cp500.py
cp720.py
cp737.py
cp775.py
cp850.py
cp852.py
cp855.py
cp856.py
cp857.py
cp858.py
cp860.py
cp861.py
cp862.py
cp863.py
cp864.py
cp865.py
cp866.py
cp869.py
cp874.py
cp875.py
cp932.py
cp949.py
cp950.py
euc_jisx0213.py
euc_jis_2004.py
euc_jp.py
euc_kr.py
gb18030.py
gb2312.py
gbk.py
hex_codec.py
hp_roman8.py
hz.py
idna.py
iso2022_jp.py
iso2022_jp_1.py
iso2022_jp_2.py
iso2022_jp_2004.py
iso2022_jp_3.py
iso2022_jp_ext.py
iso2022_kr.py
iso8859_1.py
iso8859_10.py
iso8859_11.py
iso8859_13.py
iso8859_14.py
iso8859_15.py
iso8859_16.py
iso8859_2.py
iso8859_3.py
iso8859_4.py
iso8859_5.py
iso8859_6.py
iso8859_7.py
iso8859_8.py
iso8859_9.py
johab.py
koi8_r.py
koi8_t.py
koi8_u.py
kz1048.py
latin_1.py
mac_arabic.py
mac_croatian.py
mac_cyrillic.py
mac_farsi.py
mac_greek.py
mac_iceland.py
mac_latin2.py
mac_roman.py
mac_romanian.py
mac_turkish.py
mbcs.py
oem.py
palmos.py
ptcp154.py
punycode.py
quopri_codec.py
raw_unicode_escape.py
rot_13.py
shift_jis.py
shift_jisx0213.py
shift_jis_2004.py
tis_620.py
undefined.py
unicode_escape.py
utf_16.py
utf_16_be.py
utf_16_le.py
utf_32.py
utf_32_be.py
utf_32_le.py
utf_7.py
utf_8.py
utf_8_sig.py
uu_codec.py
zlib_codec.py
mac_centeuro.py
Lib\html __init__.py
entities.py
parser.py
Lib\http *__init__.py
*client.py
*cookies.py
cookiejar.py
server.py
Lib\importlib _abc.py
*_bootstrap.py
*_bootstrap_external.py
_common.py
__init__.py
abc.py
machinery.py
resources.py
util.py
metadata.py (\lib\importlib\__init__.py) readers.py
_adapters.py
Lib\json *__init__.py
encoder.py
decoder.py
scanner.py
tool.py
Lib\logging *__init__.py
config.py
handlers.py
brython_handlers.py
Lib\multiprocessing *__init__.py
*connection.py
*pool.py
*process.py
*util.py
context.py
forkserver.py
heap.py
managers.py
popen_fork.py
popen_forkserver.py
popen_spawn_posix.py
popen_spawn_win32.py
queues.py
reduction.py
resource_sharer.py
resource_tracker.py
sharedctypes.py
shared_memory.py
spawn.py
synchronize.py
Lib\multiprocessing\dummy *__init__.py
*connection.py
Lib\pydoc_data _pydoc.css
__init__.py
*topics.py
Lib\unittest _log.py
__init__.py
__main__.py
*async_case.py
*case.py
loader.py
main.py
mock.py
result.py
runner.py
signals.py
*suite.py
util.py
Lib\unittest\test _test_warnings.py
__init__.py
__main__.py
dummy.py
support.py
test_assertions.py
*test_async_case.py
test_break.py
test_case.py
test_discovery.py
test_functiontestcase.py
test_loader.py
test_program.py
*test_result.py
*test_runner.py
test_setups.py
*test_skipping.py
test_suite.py
Lib\unittest\test\testmock __init__.py
support.py
testcallable.py
testhelpers.py
testmagicmethods.py
testmock.py
testpatch.py
testsentinel.py
testwith.py
testasync.py
testsealable.py
__main__.py
Lib\urllib __init__.py
*error.py
parse.py
*request.py
response.py
robotparser.py
libs _ast.js (built-in)
_json.js (built-in)
_locale.js (built-in)
_multiprocessing.js (\DLLs\_multiprocessing.pyd)
_sre.js (built-in)
_string.js (built-in)
_strptime.js (\lib\_strptime.py)
_symtable.js (built-in)
array.js (built-in)
builtins.js (built-in)
dis.js (\lib\dis.py)
hashlib.js (\lib\hashlib.py)
marshal.js (built-in)
math.js (built-in)
modulefinder.js (\lib\modulefinder.py)
random.js (\lib\random.py)
unicodedata.js (\DLLs\unicodedata.pyd)
_aio.js
_ajax.js
_base64.js
_binascii.js
_io_classes.js
_jsre.js
_posixsubprocess.js
_profile.js
_sre_utils.js
_svg.js
_webcomponent.js
_webworker.js
_zlib_utils.js
bry_re.js
encoding_cp932.js
html_parser.js
long_int.js
posix.js
python_re.js
python3.lib
python310.lib
_tkinter.lib
libs\crypto_js\rollups aes.js
hmac-md5.js
hmac-ripemd160.js
hmac-sha1.js
hmac-sha224.js
hmac-sha256.js
hmac-sha3.js
hmac-sha384.js
hmac-sha512.js
md5.js
pbkdf2.js
rabbit-legacy.js
rabbit.js
rc4.js
ripemd160.js
sha1.js
sha224.js
sha256.js
sha3.js
sha384.js
sha512.js
tripledes.js
web_workers import.js
test_rpc.py
test_worker.py
worker.js

Répertoires de la distribution CPython absents de Brython

  • DLLs
  • include
  • Lib\asyncio
  • Lib\ctypes
  • Lib\curses
  • Lib\dbm
  • Lib\distutils
  • Lib\ensurepip
  • Lib\idlelib
  • Lib\importlib\metadata
  • Lib\lib2to3
  • Lib\msilib
  • Lib\sqlite3
  • Lib\test\dtracedata
  • Lib\test\imghdrdata
  • Lib\test\libregrtest
  • Lib\test\test_asyncio
  • Lib\test\test_import
  • Lib\test\test_importlib\data
  • Lib\test\test_importlib\data01
  • Lib\test\test_importlib\data02
  • Lib\test\test_importlib\data03
  • Lib\test\test_importlib\namespacedata01
  • Lib\test\test_importlib\namespace_pkgs
  • Lib\test\test_importlib\partial
  • Lib\test\test_importlib\zipdata01
  • Lib\test\test_importlib\zipdata02
  • Lib\test\test_peg_generator
  • Lib\test\test_tools
  • Lib\test\test_warnings
  • Lib\test\test_zoneinfo
  • Lib\test\xmltestdata\c14n-20
  • Lib\test\ziptestdata
  • Lib\tkinter
  • Lib\turtledemo
  • Lib\venv
  • Lib\wsgiref
  • Lib\xml
  • Lib\xmlrpc
  • Lib\zoneinfo
  • Scripts
  • tcl
  • Tools