Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Now that Python 2.6 is out, what modules currently in the language should every programmer know about?

A lot of useful features in Python are somewhat "hidden" inside modules. Named tuples (new in Python 2.6), for instance, are found in the collections module.

The Library Documentation page will give you all the modules in the language, but newcomers to Python are likely to find themselves saying "Oh, I didn't know I could have done it this way using Python!" unless the important features in the language are pointed out by the experienced developers.

I'm not specifically looking for new modules in Python 2.6, but modules that can be found in this latest release.

like image 352
Bruno Gomes Avatar asked Oct 03 '08 20:10

Bruno Gomes


1 Answers

The most impressive new module is probably the multiprocessing module. First because it lets you execute functions in new processes just as easily and with roughly the same API as you would with the threading module. But more importantly because it introduces a lot of great classes for communicating between processes, such as a Queue class and a Lock class which are each used just like those objects would be in multithreaded code, as well as some other classes for sharing memory between processes.

You can find the documentation at http://docs.python.org/library/multiprocessing.html

like image 125
Eli Courtwright Avatar answered Sep 27 '22 20:09

Eli Courtwright