Giter Club home page Giter Club logo

python's Introduction

Python compilation scripts and patches to run in the browser.

https://www.beuc.net/python-emscripten/python

Build requirements: Emscripten, python3, gcc, make, quilt

Emscripten: download prebuilt binaries (or build from source)

git clone https://github.com/emscripten-core/emsdk/
pushd emsdk/
./emsdk install 2.0.2
./emsdk activate 2.0.2
popd
source emsdk/emsdk_env.sh

Python for the web browser!

cd 3.8/
./python.sh
./package-pythonhome.sh repr.py base64.py ...
emcc ... -lpython3.8 -s EMULATE_FUNCTION_POINTER_CASTS=1

Web demo: https://www.beuc.net/python-emscripten/demo/

./webprompt.sh
emrun --serve_after_close t/index.html

Real-world showcase: RenPyWeb.

Emscripten evolves regularly with (minor) breaking changes.
If you use a different version compilation may break.

Mirrors:

python's People

Contributors

beuc avatar

Stargazers

RJ Sheperd avatar kavj avatar Lobo the Swiss avatar Revvi Sudirnoputra avatar Chijun Sima avatar wdhwg001 avatar William Stein avatar raptor avatar  avatar ♫♨  ฏ๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎๎ avatar Andreas Motl avatar Jiahao Lu avatar Samuel Colvin avatar Quanyong Huang avatar Itay Dafna avatar Paul Bryden avatar Paul m. p. Peny avatar Jeff Rafter (he/him) avatar Benjamin Rigaud avatar

Watchers

Clinton Roy avatar James Cloos avatar  avatar raptor avatar

Forkers

renpytom ra2003

python's Issues

python 3.8 build requirements

The build scripts for python 2.7.10 and 2.7.18 worked without a problem with Emscripten version 1.39.18 and 2.0.2, however neither worked on the python 3.8 demo. Are there additional build requirements for the wasm build of python 3.8? I tried using gcc and clang 10.0.0.4 as the host compilers but I always get an error during the Emscripten step of python.sh.

invalid ELF header

Hi I was attempting to follow your instructions for building python 3.8 and I am getting the following error

    from decimal import Decimal
  File "/home/tom/python/3.8/build/Python-3.8.3/Lib/decimal.py", line 8, in <module>
    from _pydecimal import *
  File "/home/tom/python/3.8/build/Python-3.8.3/Lib/_pydecimal.py", line 440, in <module>
    import contextvars
  File "/home/tom/python/3.8/build/Python-3.8.3/Lib/contextvars.py", line 1, in <module>
    from _contextvars import Context, ContextVar, Token, copy_context
ImportError: /home/tom/python/3.8/build/Python-3.8.3/emscripten/build/lib.emscripten-3.8/_contextvars.so: invalid ELF header

I tried building using the latest emscripten as well as 2.0.2 and 1.39.18 mentioned in the closed thread
I am trying to build on Ubuntu 20.04.2 LTS my system python3 is Python 3.8.5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.