Live data from Hacker News

PythonMonk – Learn Python in the browser

pythonmonk.com

31–40 of 50 posts

Re: PythonMonk – Learn Python in the browser

#31
post #26
post #10

Earlier quoted context omitted.

I don't know anyone who uses Python 3 in production. It's still seen as an experimental implementation.

I dont' know Python but I'm thinking about learning it. What's experimental about Python 3? I don't have any legacy reasons to start with 2.7. Why wouldn't I just start with 3?

there's nothing experimental about Python 3. its a stable release version and I think its already up to sub version 3.3.

HOWEVER, there are many important 3rd party libraries that have not yet been migrated to be fully compatible with Python 3. these libraries are far more important to writing real applications than the ability to use some newer syntactic constructs in Python 3.

Re: PythonMonk – Learn Python in the browser

#32
post #26

Earlier quoted context omitted.

I dont' know Python but I'm thinking about learning it. What's experimental about Python 3? I don't have any legacy reasons to start with 2.7. Why wouldn't I just start with 3?

there's nothing experimental about Python 3. its a stable release version and I think its already up to sub version 3.3. HOWEVER, there are many important 3rd party libraries that have not yet been migrated to be fully compatible with Python 3. these libraries are far more important to writing real applications than the ability to use some newer syntactic constructs in Python 3.

> HOWEVER, there are many important 3rd party libraries that have not yet been migrated to be fully compatible with Python 3.

Are there any particular libraries blocking you? Numpy / SciPy, IPython, Requests, Django, Pyramid, Bottle, etc. have all been ported to Python 3.

Re: PythonMonk – Learn Python in the browser

#33
"Your turn now - go on and change the following code to compute the sum of the numbers 1 through 5."

If you input 15 and submit, it says the answer is correct. Do all online code courses just check for the retured value?

How do these services deal with someone running sum(i for i in xrange(1000000000000000000))?

Re: PythonMonk – Learn Python in the browser

#34

Interesting, however I feel like learning to code in a browser (even if it's JavaScript) doesn't work. Sure, you may learn how to do a for loop or how variables work. But, you don't learn how to actually use the language. Setting up a development environment, and understanding how everything is connected is much more important. Let's say you ace everything here, on CodeAcademy, etc. You still can't actually build any…

this kind of thing is a good resource for people who already know how to code, but need a fast and elegant syntax guide. its not useful for teaching beginners because, as you've said, it doesn't deal with the tool chain or project organization, etc. but if you know Ruby and want to learn Python, this is a great resource.

Agreed. I'm actually learning Python at the moment (coming from Ruby & Java), and am finding this useful. Generally I don't think too highly of coding in a browser.

Re: PythonMonk – Learn Python in the browser

#35
post #33

"Your turn now - go on and change the following code to compute the sum of the numbers 1 through 5." If you input 15 and submit, it says the answer is correct. Do all online code courses just check for the retured value? How do these services deal with someone running sum(i for i in xrange(1000000000000000000))?

But of course that is a valid piece of code!

"15" completely matches the specification you give.

Re: PythonMonk – Learn Python in the browser

#36

Earlier quoted context omitted.

there's nothing experimental about Python 3. its a stable release version and I think its already up to sub version 3.3. HOWEVER, there are many important 3rd party libraries that have not yet been migrated to be fully compatible with Python 3. these libraries are far more important to writing real applications than the ability to use some newer syntactic constructs in Python 3.

> HOWEVER, there are many important 3rd party libraries that have not yet been migrated to be fully compatible with Python 3. Are there any particular libraries blocking you? Numpy / SciPy, IPython, Requests, Django, Pyramid, Bottle, etc. have all been ported to Python 3.

The Python 3 Wall of Superpowers / Shame lists them for you in order of downloads: http://python3wos.appspot.com/

Re: PythonMonk – Learn Python in the browser

#38
post #30
post #27

Earlier quoted context omitted.

This particular behaviour can occur because the process is disallowed to call fork() and can be done with setrlimit() (see RLIMIT_NPROC). There should be other protections, though, because forking a "ls" is not the only way to access the filesystem.

Ah, interesting. File system access isn't blocked completely: __import__("os").listdir("/evaluate") open("/evaluate/test.py").readlines()

Execv'ing processes is OK as long as you don't fork:

    __import__("os").execv("/usr/bin/uname", ["uname", "-a"])
    Linux ip-10-196-3-111 2.6.32-amazon-xen-r3 #1 SMP Mon Jan 16 21:03:16 PST 2012 i686 GNU/Linux
As for the actual files, there are a few clues that a chroot is created for every request : /proc is not mounted, /etc is minimal (root + 1 user in passwd) and "ls -id /" returns a new inode number every time.

Re: PythonMonk – Learn Python in the browser

#39

Earlier quoted context omitted.

there's nothing experimental about Python 3. its a stable release version and I think its already up to sub version 3.3. HOWEVER, there are many important 3rd party libraries that have not yet been migrated to be fully compatible with Python 3. these libraries are far more important to writing real applications than the ability to use some newer syntactic constructs in Python 3.

> HOWEVER, there are many important 3rd party libraries that have not yet been migrated to be fully compatible with Python 3. Are there any particular libraries blocking you? Numpy / SciPy, IPython, Requests, Django, Pyramid, Bottle, etc. have all been ported to Python 3.

To be fair, Django only supports Python 3 as of 1.5, which was released a bit more than a month ago.

Re: PythonMonk – Learn Python in the browser

#40
post #20

The first thing I always try on sites like these is stuff like this: __import__('commands').getstatusoutput('ls /') or __import__('subprocess').call(["ls", "-l"]) which gets blocked by the interpreter somehow with exceptions.OSError - [Errno 11] Resource temporarily unavailable I'm curious as to how you managed to do this - I've always been interested in how to sandbox something like this.

My very favorite Python sandboxing method is the one used by repl.it:

http://repl.it/languages/Python

They compiled CPython with Emscripten, and it gets run on your browser.

Post reply on HN