Didn't we decide a long while back that fully featured programming languages were dangerous in the browser, especially if they could do disk I/O? Even if sandboxed? A la Java Applets and Adobe Flash? import os for subdir, dirs, files in os.walk('./'): for file in files: print file os.remove(file) Perhaps the environment is "fake", and these files don't really exist, even in some sandbox... otherwise, seems like this…
I don't know about PyPy.js specifically, but most systems like this provide a virtual filesystem that maps back to things like indexedDB and localstorage which are browser APIs. There is no way that pypy.js is able to access local files on your machine outside of the browser sandbox.
PyPy.js: Python in the web browser
51–60 of 129 posts
Re: PyPy.js: Python in the web browser
#52My code basically calls int(time.time()) until its value changes, doing i+=1 for every time it did not change (n=10 for every platform (python2/3/pypy/browser)). My browser is Firefox 61, full code here: https://hastebin.com/turenofise.py
Re: PyPy.js: Python in the web browser
#53Earlier quoted context omitted.
I've been thinking about building this for Tcl. Tcl has been available in the browser in various forms for decades, but one thing that makes Tcl uniquely suited to a web application style development is its threading model. In Tcl, you access a thread by sending messages to it, in which a Tcl interpreter inside its event loop processes. My plan was to have a client-side Tcl program in the browser that automatically i…
But then you have to code in... Tcl...
Re: PyPy.js: Python in the web browser
#54Re: PyPy.js: Python in the web browser
#55 import antigravityRe: PyPy.js: Python in the web browser
#56This is pretty old, and hasn't seen an update in over a year. I never understand why links links this get posted with no discussion to start it off with. Also, wouldn't this be better implemented with WASM?
Re: PyPy.js: Python in the web browser
#57Earlier quoted context omitted.
I've been thinking about building this for Tcl. Tcl has been available in the browser in various forms for decades, but one thing that makes Tcl uniquely suited to a web application style development is its threading model. In Tcl, you access a thread by sending messages to it, in which a Tcl interpreter inside its event loop processes. My plan was to have a client-side Tcl program in the browser that automatically i…
But then you have to code in... Tcl...
Re: PyPy.js: Python in the web browser
#58Didn't we decide a long while back that fully featured programming languages were dangerous in the browser, especially if they could do disk I/O? Even if sandboxed? A la Java Applets and Adobe Flash? import os for subdir, dirs, files in os.walk('./'): for file in files: print file os.remove(file) Perhaps the environment is "fake", and these files don't really exist, even in some sandbox... otherwise, seems like this…
import os
os.listdir('/')
The answer, by the way, is no.Re: PyPy.js: Python in the web browser
#59It is used by a class taught on Coursera (Introduction to Interactive Programming in Python)
From what I can see:
- PyPy.js benefit: runs faster
- codeskulptor benefit: can use GUI components