You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>modules</str<strong>on</strong>g> <strong>on</strong> <strong>PWF</strong> <strong>Linux</strong>This is an n<strong>on</strong>-exhaustive list of <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> <str<strong>on</strong>g>modules</str<strong>on</strong>g> <strong>on</strong> <strong>PWF</strong> <strong>Linux</strong>. Most are standard <str<strong>on</strong>g>modules</str<strong>on</strong>g> for theversi<strong>on</strong> of <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> we run (2.6) and would be found <strong>on</strong> any similar <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> installati<strong>on</strong>. Those that havebeen installed specially for <strong>PWF</strong> <strong>Linux</strong> are marked with an asterisk.An alphabetic list of every module shipped with <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> can be found athttp://docs.pyth<strong>on</strong>.org/modindex.htmlthough the quality of the documentati<strong>on</strong> varies wildly.Please note that these <str<strong>on</strong>g>modules</str<strong>on</strong>g> are not in alphabetic order, but grouped thematically. This is not meantto be a reference for you to look up what a module does (use the URL above for that) but rather aquick skim read to see what there is.Nameossysplatformsubprocesstempfilegetopt* Descripti<strong>on</strong>access to operating system-specific functi<strong>on</strong>s (see the course “<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>:Operating System Access” for some of the ways this module can be used)access to comm<strong>on</strong> system functi<strong>on</strong>alityaccess to underlying platform’s identifying datacall external commands and get access to their standard input, standard output,standard error and return code (available in <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> 2.4 and later; see the course“<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>: Operating System Access” for details)securely generate temporary files and directories (see the course “<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>:Further Topics” for details)parsing command lines, with --verbosity=4, --verbose and -v styleopti<strong>on</strong>smathcmathrandomnumpyscipyaccess to the set of (floating point) mathematical functi<strong>on</strong>s defined by the Cstandardthe complex equivalent of mathpseudo-random number generators for various distributi<strong>on</strong>s* A set of functi<strong>on</strong>s and types suitable for numerical processing of arrays ofvarious sorts of numbers (integers, floats, complex). (See the course “<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>:Interoperati<strong>on</strong> with Fortran” for examples of how this module might be used.)For more details <strong>on</strong> NumPy, see:http://numpy.scipy.org/and http://www.scipy.org/Documentati<strong>on</strong>* A scientific computing package built <strong>on</strong> top of NumPy. For more details <strong>on</strong>SciPy, see:http://www.scipy.org/Documentati<strong>on</strong>recsvbase64binhexuuregular expressi<strong>on</strong>s (see the course “<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>: Regular Expressi<strong>on</strong>s” for details)encoding and decoding of data in comma separated value format as comm<strong>on</strong>lyused by spreadsheets and relati<strong>on</strong>al databases (see the course “<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>: FurtherTopics” for details)encoding and decoding for Base64 encoded data, a format comm<strong>on</strong>ly used totransfer data files in emailencoding and decoding for files in binhex4 format, a format allowingrepresentati<strong>on</strong> of Macintosh files in ASCIIencoding and decoding files in uuencode format, allowing arbitrary binary datato be transferred over ASCII-<strong>on</strong>ly c<strong>on</strong>necti<strong>on</strong>s
Name* Descripti<strong>on</strong>picklecPickleSerializing and de-serializing <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> object structures for storage.(See the course “<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>: Checkpointing” for details.)An implementati<strong>on</strong> of the pickle module written in C rather than <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> forimproved performance. (Both <str<strong>on</strong>g>modules</str<strong>on</strong>g> provide equivalent structures.) Thepickle module is better for testing and debugging; the cPickle module isbetter at run time. (See the course “<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>: Checkpointing” for details.)GnuplotploticusmatplotlibImage* Provides an interface to the gnuplot data and functi<strong>on</strong> plotting package,allowing the use of gnuplot from within <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>. (See the course “<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>:Further Topics” for examples of how this module might be used.) For moredetails <strong>on</strong> this module, see:http://gnuplot-py.sourceforge.net/* Provides an interface to the ploticus API, allowing the use of ploticus-relatedfuncti<strong>on</strong>s from within <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>. ploticus is an alternative to gnuplot forproducing plots, charts and graphics from data. (See the course “<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>:Further Topics” for examples of how this module might be used.) For moredetails <strong>on</strong> this module, see:http://www.srcc.lsu.edu/pyploticus.html* A plotting library that allows MATLAB®-style plotting in <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>. (See thecourse “<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>: Further Topics” for examples of how this module might beused.) For more details <strong>on</strong> this module, see:http://matplotlib.sourceforge.net/* Main module of the <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> Imaging Library (PIL). PIL provides fairlypowerful image processing capabilities and supports a large number of imagefile formats. For more details <strong>on</strong> PIL, see:http://www.pyth<strong>on</strong>ware.com/products/pil/index.htmsqlite3anydbm<str<strong>on</strong>g>modules</str<strong>on</strong>g> for interfacing to a simple SQL database built around local files(shipped with <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> 2.5 and later)generic interface to variants of the DBM databasebz2gzipzlibzipfileinterface for the bz2 compressi<strong>on</strong> libraryinterface for the zlib compressi<strong>on</strong> library for reading and writing gzip filesinterface for the zlib compressi<strong>on</strong> librarywork with zip filesunittestThe <str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g> unit testing framework.(See the course “<str<strong>on</strong>g>Pyth<strong>on</strong></str<strong>on</strong>g>: Unit Testing” for details.)