Hacker News new | past | comments | ask | show | jobs | submit login

Sadly, "import antigravity" doesn't work



I was more disappointed (but not surprised!) that "import pip" didn't work.

If it did (and it has big ramifications for how much of "python" (for some definition of "python" that includes most of the standard library) works. Eg sockets, interacting with some sort of "local" "file-system" etc) one could (this is handy if working on windows, and running python via cmd-r python.exe):

  import pip
  # pip.main expects a list of arguments, hence .split() 
  pip.main("install ipython".split())
     # Only needed first
     # time, as it installs ipython under site-packages.
     # Only works if the user has write access, obviously

  import IPython
  IPython.start_ipython()


That would be a total security nightmare and hopefully it's never going to happen.

I'd be happy enough with serving .py files with the exact same restrictions and privileges that JS libraries have now.


> That would be a total security nightmare and hopefully it's never going to happen.

Why? You're assuming a lot of things about a hypothetical implementation that is going to have heavy restrictions on in anyway since it's running in the javascript sandbox.


How is that worse than javascript loading javascript via AJAX?


Yes, but "import this" does!

(However, it took about 10 seconds to execute. Maybe that's the network I'm on, but even so...)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: