Calling a C program from a Python Script
Brad Tilley
bradtilley at gmail.com
Thu Dec 9 14:03:42 EST 2004
More information about the Python-list mailing list
Thu Dec 9 14:03:42 EST 2004
- Previous message (by thread): Calling a C program from a Python Script
- Next message (by thread): Calling a C program from a Python Script
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Steven Bethard wrote: >>> for root, files, dirs in os.walk(path) >>> for f in files: >>> try: >>> x = file(f, 'rb') >>> data = x.read() >>> x.close() > > > Remember that CPython is implemented in C, and so all the builtin types > (including file) basically execute C code directly. My experience with > Python file objects is that they are quite fast when you're doing simple > things like the example above. I'm dealing with a terabyte of files. Perhaps I should have mentioned that.
- Previous message (by thread): Calling a C program from a Python Script
- Next message (by thread): Calling a C program from a Python Script
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list