News for hackers. Stuff that matters.
Re:Show HN: Online Python Compiler with Libraries by metadat on Friday March 14, 2025 @11:55PM (#43369850)

  import requests 
  
  r = requests.get('https://theonion.com')
  
  print(r.text)
Hmm, I wonder if you could use subprocess to fetch and run any binary. What kind of sandbox is this running in, and what are the limits?

Running arbitrary untrusted code seems like a potential security issue.

Re:Show HN: Online Python Compiler with Libraries by porridgeraisin on Saturday March 15, 2025 @12:51AM (#43370076)
It runs on pyodide, i.e, a wasm interpreter that runs entirely in your browser.
Re:Show HN: Online Python Compiler with Libraries by andycloke on Saturday March 15, 2025 @03:57AM (#43370847)
Maker here! Runs in an isolated Web Worker using Web Assembly, via Pyodide. Everything runs locally in your browser - no file system or other access. Scheduled run (paid plan) run on AWS lambda.

So, yes, sadly, network requests only work with domains with Access-Control-Allow-Origin: *. I'm looking at adding a backend CORS proxy to fix this.

We also have a Chrome extension with no CORS limitation. The extension lets you right-click Python code snippets on basically any site (Claude, ChatGPT, Deepseek etc.) to run it instantly.

https://chromewebstore.google.com/detail/python-code-runner/...

Re:Show HN: Online Python Compiler with Libraries by metadat on Saturday March 15, 2025 @11:58AM (#43373337)
You might check out https://e2b.dev, they already have a really robust sandbox system with nice SDKs.
Re:Show HN: Online Python Compiler with Libraries by andycloke on Sunday March 16, 2025 @05:44AM (#43377850)
Interesting, thanks
Re:Show HN: Online Python Compiler with Libraries by hoodchatham on Saturday March 15, 2025 @05:01AM (#43371140)
Yes, it has all the normal CORS restrictions. If you're curious, the PR that added support for this is here: https://github.com/urllib3/urllib3/pull/3195
[dead]
Re:Show HN: Online Python Compiler with Libraries by andycloke on Saturday March 15, 2025 @04:04AM (#43370876)
Maker here.

You're right, it's an interpreter and that would be the 100% accurate term.

For online coding environments, the two are often used interchangeably. More people search for 'compiler', so I'm using that widely on my site.

Re:Show HN: Online Python Compiler with Libraries by alextingle on Saturday March 15, 2025 @04:56AM (#43371117)
Who would search for "Python compiler"?

Honestly: It makes it sound like you literally have no idea what you're talking about. Not a good look for someone trying to sell a service.

Re:Show HN: Online Python Compiler with Libraries by userbinator on Saturday March 15, 2025 @05:25AM (#43371253)
Who would search for "Python compiler"?

Those who actually want to produce binaries from their Python scripts, which this doesn't do.

Re:Show HN: Online Python Compiler with Libraries by d0mine on Saturday March 15, 2025 @06:50AM (#43371634)
I personally saw how novice Python programmers searched for “Python compiler” while their actual intent was to find Python REPL/execution environment online (pythontutor, ideone, repl.it, trinket.io, etc)

Many of this services use “compiler” in their description. It may be technically true if they use Python implementation that compiles Python source to byte code first, and then interprets the resulting bytecode (like CPython, Pypy implementation do).

Re:Show HN: Online Python Compiler with Libraries by gardnr on Saturday March 15, 2025 @12:53AM (#43370086)
Great project! Nice work!

It reminds me a bit of marimo: https://docs.marimo.io/guides/publishing/

Re:Show HN: Online Python Compiler with Libraries by andycloke on Saturday March 15, 2025 @04:01AM (#43370865)
Maker here. Thank you!

I looked briefly at Marimo when building - awesome project. I wasn't sure about building on Pydodide as it's obviously not full Python compatibility. But seeing someone else building a popular project on it helped me make that decision!

Re:Show HN: Online Python Compiler with Libraries by Rush2112 on Saturday March 15, 2025 @03:41AM (#43370772)
Hi, great project! Can you add the library pylan? https://pypi.org/project/pylan-lib/
Re:Show HN: Online Python Compiler with Libraries by andycloke on Saturday March 15, 2025 @03:50AM (#43370821)
Yes! To use pylan:

- Click on the Clip name (the default one is 'Use Python Libraries') - Click 'Manage packages' - Enter 'pylan-lib' and Click 'Add' - Click 'Run'

The package will be installed, and the code will run!

The list of libraries is only a small subset of the compatible libraries - I should make that way clearer.

Re:Show HN: Online Python Compiler with Libraries by Rush2112 on Saturday March 15, 2025 @03:58AM (#43370854)
ah ok. Thanks!
Re:Show HN: Online Python Compiler with Libraries by arbitrandomuser on Saturday March 15, 2025 @09:20AM (#43372361)
What am I paying for if it's running on my system ? Not asking to deride , but could you elaborate what value this adds over simple installing python on my system ?
Re:Show HN: Online Python Compiler with Libraries by mscolnick on Saturday March 15, 2025 @05:49PM (#43375375)
Looks awesome! big fans of pyodide, congrats on the launch