I recently saw something pretty cool on kaggle. When you fill out and run cells in their tutorial notebooks you get pretty much like live feedback, if you did it right or not. I would love to be able to implement my own exercises this way, so that I can hand those notebooks out to my class and the students would get immediate feedback on their programming.
So far I seem to be unable to find how this is done or maybe I miss the right words to put into Google.
I found the nbgrader, but that isn't exactly what I was searching for.
Is there a way to do such evaluation directly in the notebooks, or does Kaggle probably use some other software in the backend to get this effect of direct evaluation?
Or can I maybe use unittests in some fashion to get such an effect?
I have an external program, opentrack, that tracks head position using IR LED's. The position is updated in the program in real-time, but my problem is that I would like to get that data into my python code. Is it possible to do this?
I've been looking into subprocesses and things like that, but I still don't understand how to do it. Sorry for the very general question but I just need someone to point me into the right direction or to tell me that it isn't really possible.
The page you linked to clearly lists no fewer than 9 different ways in which opentrack can output the data.
So you need to figure out which one to use, and write Python code to act as a receiver for one of those methods. Perhaps UDP, since that sounds simple enough.
Hint: to decode any binary format, you're probably going to want to become familiar with Python's struct module.
I have a long text to expose to the user in a console, for him to make his choice. And I still haven't found how to reproduce the less/more effect with Python.
I'd be grateful for some directions on the proper way to achieve that. After a lot of googling I just understood that I don't know the tools or the appropriate vocabulary to get my way around this.
less and more mainly use terminal capabilities.
The main problem with these program is that most of them are made in c using termios.h/curses.h, so no great documentation about terminal capabilities exist in python but a good start should be the python termios doc and the gnu C library reference.
After a quick lookup the curses wrapper in python should also be able to do the job.
I am trying to learn Python and referencing the documentation for the standard Python library from the Python website, and I was wondering if this was really the only library and documentation I will need or is there more? I do not plan to program advanced 3d graphics or anything advanced at the moment.
Edit:
Thanks very much for the responses, they were very useful. My problem is where to start on a script I have been thinking of. I want to write a script that converts images into a web format but I am not completely sure where to begin. Thanks for any more help you can provide.
For the basics, yes, the standard Python library is probably all you'll need. But as you continue programming in Python, eventually you will need some other library for some task -- for instance, I recently needed to generate a tone at a specific, but differing, frequency for an application, and pyAudiere did the job just right.
A lot of the other libraries out there generate their documentation differently from the core Python style -- it's just visually different, the content is the same. Some only have docstrings, and you'll be best off reading them in a console, perhaps.
Regardless of how the other documentation is generated, get used to looking through the Python APIs to find the functions/classes/methods you need. When the time comes for you to use non-core libraries, you'll know what you want to do, but you'll have to find how to do it.
For the future, it wouldn't hurt to be familiar with C, either. There's a number of Python libraries that are actually just wrappers around C libraries, and the documentation for the Python libraries is just the same as the documentation for the C libraries. PyOpenGL comes to mind, but it's been a while since I've personally used it.
As others have said, it depends on what you're into. The package index at http://pypi.python.org/pypi/ has categories and summaries that are helpful in seeing what other libraries are available for different purposes. (Select "Browse packages" on the left to see the categories.)
One very common library, that should also fit your current needs, is the Python Image Library (PIL).
Note: the latest version is still in beta, and available only at Effbot site.
If you're just beginning, all you'll need to know is the stuff you can get from the Python website. Failing that a quick Google is the fastest way to get (most) Python answers these days.
As you develop your skills and become more advanced, you'll start looking for more exciting things to do, at which point you'll naturally start coming across other libraries (for example, pygame) that you can use for your more advanced projects.
It's very hard to answer this without knowing what you're planning on using Python for. I recommend Dive Into Python as a useful resource for learning Python.
In terms of popular third party frameworks, for web applications there's the Django framework and associated documentation, network stuff there's Twisted ... the list goes on. It really depends on what you're hoping to do!
Assuming that the standard library doesn't provide what we need and we don't have the time, or the knowledge, to implement the code we reuse 3rd party libraries.
This is a common attitude regardless of the programming language.
If there's a chance that someone else ever wanted to do what you want to do, there's a chance that someone created a library for it. A few minutes Googling something like "python image library" will find you what you need, or let you know that someone hasn't created a library for your purposes.
I want to learn it but I have no idea where to start. Everything out there suggests reading the libpurple source but I don't think I understand enough c to really get a grasp of it.
There isn't much about it yet... the intro, the howto, and the sources (here browsing them online but of course you can git clone them) are about it. In particular, the tiny example client you can get from here does have some miniscule example of use of purple's facilities (definitely not enough, but maybe it can get you started with the help of some 'dir', 'help' and the like...?)
Not sure how much help this will be but based on information from here, it seems like you just install python-purple and import and call the functions as normal Python functions.
Can't help you with a concrete example as I decided to use something else. However, one of the first things I wanted to do after I cloned the repo was remove the ecore dependency. Here's a patch submitted to the mailing list to do just that: https://garage.maemo.org/pipermail/python-purple-devel/2009-March/000000.html
Incidentally, if you're looking for AIM take a look at twisted.words. For Yahoo, trying getting the source for curphoo or zinc (both are console YMSG clients). For GTalk/Jabber, I've had good experiences with xmpppy.