PythonMonk – Learn Python in the browser(pythonmonk.com) |
PythonMonk – Learn Python in the browser(pythonmonk.com) |
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 anything.
(For more on this, see this article from HN a few days ago: http://blog.zackshapiro.com/want-to-learn-to-code-start-here)
I really don't buy the "you have to own a car to drive one arguments" and the whole point of modern software engineering is to pull you away from the assumption of full system control and the ability to make problems go away with shell skills.
But, I would like more immediate source code management integration. That is the essential reality I always see lacking..
A non-programmer that understood git basics would be more helpful to me as a colleague than a competent programmer that doesn't.
We'll get to the rest fairly quickly, though that would likely be in the form of screencasts.
PS: I'm on the CodeMonk team, the folks that are behind PythonMonk.com and RubyMonk.com
__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.
http://repl.it/languages/Python
They compiled CPython with Emscripten, and it gets run on your browser.
File system access isn't blocked completely:
__import__("os").listdir("/evaluate")
open("/evaluate/test.py").readlines()
Our courseware marketplace is still in a private alpha, but we are actively soliciting awesome hackers that would like to teach online.
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))?
"15" completely matches the specification you give.
def unique(s):
return list(set(s))
and it gave assertion errors. Nice presentation ... but incorrect Python implementation.def unique(values): """Finds all unique elements of a list.
>>> unique([])
[]
>>> unique([1, 2, 1])
[1, 2]
>>> unique([1, 2, 1, 3, 4, 2])
[1, 2, 3, 4]
"""
# your code here
return list(set(values))
it also works without the coercion to list. return set(values) is fine.Solution to that problem is correct. Sets weren't introduced yet.
"Evaluates to True when age is 40 and name is "Bob" , which should be fine i think.
More interestingly, can I get transfer credits from Codecademy instead?
- Zed Shaw, "Learn Python the Hard Way"
__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.- Tejas from Team PythonMonk (I built the sandboxing stuff)
Gives you a few clues as well
import inspect
import pprint
pp = pprint.PrettyPrinter(depth=6)
f = inspect.currentframe()
c = 0
while f is not None:
c += 1
if c == 20:
print f.f_code
pp.pprint(dict(inspect.getmembers(f.f_code)))
f = f.f_backhttp://docs.python.org/3/howto/pyporting.html#use-same-sourc...
Second, most software of any complexity will have dependencies. Although progress has been made, several packages that many projects depend upon are still red:
P.S. I'm the author of Python Primer on pythonmonk.com
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.
Are there any particular libraries blocking you? Numpy / SciPy, IPython, Requests, Django, Pyramid, Bottle, etc. have all been ported to Python 3.
PIL as well. similar reasons. django image fields are dependent on PIL.
Celery is still on Python 2 also, and while there are other message queues available, none of them is as easy to integrate with for an app that's already written in Python.