3 ms·
Sadly, "import antigravity" doesn't work
by nighthawk454 11y ago
Sadly, "import antigravity" doesn't work
- reuven 11y agoYes, but "import this" does! (However, it took about 10 seconds to execute. Maybe that's the network I'm on, but even so...)
- e12e 11y agoI 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()
- toyg 11y agoThat 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.
- fragmede 11y ago> 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.
- e12e 11y agoHow is that worse than javascript loading javascript via AJAX?
- deleted 11y ago[deleted]