This page is a collection of various Python goodies I've created. Everything here is covered by the MIT License. Please let me know if you have any questions or feedback by sending email to firstname.lastname@example.org.
EasyDialogs for Windows 46691.0 - a
lightweight port of the Macintosh EasyDialogs module
Download - run to install
Requires: Microsoft Windows, Python 2.3 or higher, and ctypes 0.9.6. UnRAR.dll is included with pyUnRAR.
A change history is below.
pyUnRAR is a ctypes based wrapper around the free UnRAR.dll. It enables reading and unpacking of archives created with the RAR/WinRAR archivers. There is a low-level interface which is very similar to the C interface provided by UnRAR.dll. There is also a high-level interface which makes some common operations easier.
Here are some examples of the high-level interface:
import UnRAR # extract all the files in test.rar UnRAR.Archive('test.rar').extract() # extract all the files in test.rar matching the wildcard *.txt UnRAR.Archive('test.rar').extract('*.txt') # print the name and size of each file, extracting small ones for fileInArchive in UnRAR.Archive('test.rar').iterfiles(): print fileInArchive.filename, fileInArchive.size if fileInArchive.size <= 1024: fileInArchive.extract() # print the contents of any file whose name ends with test.txt for fileInArchive in UnRAR.Archive('test.rar').iterfiles(): if fileInArchive.filename.endswith('test.txt'): print fileInArchive.open('rt').read()
Version 1.0 (12/12/2005)