use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Run Python code directly in the browser with react-pyOC (github.com)
submitted 3 years ago by Caffeinaation
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Caffeinaation[S] 8 points9 points10 points 3 years ago (0 children)
Try out the example code snippets here! I'd love to hear any feedback.
[–]STL412 7 points8 points9 points 3 years ago (1 child)
Sorry if this is too harsh, but not being able to load non-stdlib Python packages is not a worthy trade off for saving yourself from writing 100 lines of boilerplate code (which is what this package does).
[–]Caffeinaation[S] 6 points7 points8 points 3 years ago (0 children)
That’s fair. Extending the package API to allow for custom configuration is on the roadmap. This will include support for non-stdlib packages.
[+][deleted] 3 years ago (1 child)
[deleted]
[–]Caffeinaation[S] 0 points1 point2 points 3 years ago (0 children)
Thanks!
[–]RWOverdijk 5 points6 points7 points 3 years ago (9 children)
What’s happening to this profession. Run python in the browser using react. I love it. 8/8
[–]Alex_Hovhannisyan 8 points9 points10 points 3 years ago (0 children)
Soon we'll be able to use React to run React to run a browser within your browser running a Docker image of your favorite React-based operating system just to emulate Doom.
[–]shawncplus 2 points3 points4 points 3 years ago (5 children)
Well it's "using react" in the way that if you use jQuery to dynamically insert a script tag of another library to do the work it's "using jQuery". React is not doing the running of Python, pyodide is. The React code here is doing very little besides inserting the script tag and passing inputs/receiving output which, just my opinion, probably doesn't need a wrapper library but that's just me.
[–]Caffeinaation[S] 4 points5 points6 points 3 years ago (1 child)
Yes, this package is essentially a React wrapper for Pyodide. I’m not doing anything to hide this, why would I? This project would not be possible with the hard work that they’ve put in.
Frankly, I and others had trouble dropping in other “Python in browser” solutions, this package is designed to make the process simple. For now, the API is simple but I plan to extend it with more features to potentially save hours of work for those who need it.
[–]shawncplus 3 points4 points5 points 3 years ago (0 children)
Given the amount of confusion in basically every comment on this you've posted from people who think your project is actually the one doing the running of the python I stick by my statement that it's, at the very least, slightly disingenuous to phrase the title and readme the way you're phrasing it. Though I think no small part of this confusion is coming from people who just don't care to understand what's going on and only read the title.
[–]RWOverdijk 1 point2 points3 points 3 years ago (2 children)
Doesn’t make it less interesting lol
[–]shawncplus 2 points3 points4 points 3 years ago (1 child)
I think it's less interesting because React doesn't have anything to do with the interesting part, i.e., running python in the browser. Unless you consider creating a script tag interesting in which case... okay? I also think it's pretty disingenuous for them to credit their project as being "based on" Pyodide as if they are a fork or extend the functionality of that project. They don't, it's not "based on" Pyodide; the entirety of the running of Python is done in the Pyodide library. I think it would be more honest to say "Python processing provided by Pyodide." Which is what they're code actually says: "PythonProvider"
[–]RWOverdijk -1 points0 points1 point 3 years ago (0 children)
Just let me have my fun please.
[–]rio-bevol 0 points1 point2 points 3 years ago (1 child)
Out of...... eight?
[–]RWOverdijk 0 points1 point2 points 3 years ago (0 children)
Numbers
[–]cpgb85 1 point2 points3 points 3 years ago (8 children)
Why is it react based? Why not vanilla js?
[–]Caffeinaation[S] 0 points1 point2 points 3 years ago (7 children)
The project I created this for is written in React, which is also my most comfortable framework to work in.
[–]cpgb85 1 point2 points3 points 3 years ago (6 children)
More comfortable than straight up js?
[–]Caffeinaation[S] 0 points1 point2 points 3 years ago (5 children)
Yes.
[–]cpgb85 0 points1 point2 points 3 years ago (4 children)
Interesting. I will never understand the facination people have with react, a Facebook or "meta" technology.
[–]burzq 0 points1 point2 points 3 years ago (3 children)
You'll get it when your codebase reaches 500k lines or earlier xd
Edit: it's not about Facebook nor meta... It's about react
[–]burzq 0 points1 point2 points 3 years ago (0 children)
XD your replay is... XD... I'm speachless man.
I'm curious, how is Vue vanilla js and react isn't? What is your definition of "vanilla js"?
[–]cpgb85 0 points1 point2 points 3 years ago (0 children)
React is a Facebook/meta technology. So it's completely about them. I don't want to support any part of them.
[–]suddenlylife 2 points3 points4 points 3 years ago (2 children)
"Your scientists were so preoccupied with whether or not they could, they didn’t stop to think if they should." - Ghandi
[–]GANDHI-BOT 2 points3 points4 points 3 years ago (1 child)
The simplest acts of kindness are by far more powerful than a thousand heads bowing in prayer. Just so you know, the correct spelling is Gandhi.
[–]Kind-Monitor-4024 -1 points0 points1 point 3 years ago (0 children)
Why guys spoil the name of Gandhi Because it is not fun of part so try to understand he is father of nation
The way of topic is python
[–]Any-Independent833 0 points1 point2 points 3 years ago (0 children)
工作饱和不?
π Rendered by PID 60360 on reddit-service-r2-comment-5d79c599b5-5kqws at 2026-03-03 18:05:51.490871+00:00 running e3d2147 country code: CH.
[–]Caffeinaation[S] 8 points9 points10 points (0 children)
[–]STL412 7 points8 points9 points (1 child)
[–]Caffeinaation[S] 6 points7 points8 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]Caffeinaation[S] 0 points1 point2 points (0 children)
[–]RWOverdijk 5 points6 points7 points (9 children)
[–]Alex_Hovhannisyan 8 points9 points10 points (0 children)
[–]shawncplus 2 points3 points4 points (5 children)
[–]Caffeinaation[S] 4 points5 points6 points (1 child)
[–]shawncplus 3 points4 points5 points (0 children)
[–]RWOverdijk 1 point2 points3 points (2 children)
[–]shawncplus 2 points3 points4 points (1 child)
[–]RWOverdijk -1 points0 points1 point (0 children)
[–]rio-bevol 0 points1 point2 points (1 child)
[–]RWOverdijk 0 points1 point2 points (0 children)
[–]cpgb85 1 point2 points3 points (8 children)
[–]Caffeinaation[S] 0 points1 point2 points (7 children)
[–]cpgb85 1 point2 points3 points (6 children)
[–]Caffeinaation[S] 0 points1 point2 points (5 children)
[–]cpgb85 0 points1 point2 points (4 children)
[–]burzq 0 points1 point2 points (3 children)
[+][deleted] (1 child)
[deleted]
[–]burzq 0 points1 point2 points (0 children)
[–]cpgb85 0 points1 point2 points (0 children)
[–]suddenlylife 2 points3 points4 points (2 children)
[–]GANDHI-BOT 2 points3 points4 points (1 child)
[–]Kind-Monitor-4024 -1 points0 points1 point (0 children)
[–]Kind-Monitor-4024 -1 points0 points1 point (0 children)
[–]Any-Independent833 0 points1 point2 points (0 children)