Now for the flames...
ben at co.and.co
ben at co.and.co
Sat Jun 24 07:16:53 EDT 2000
More information about the Python-list mailing list
Sat Jun 24 07:16:53 EDT 2000
- Previous message (by thread): Now for the flames...
- Next message (by thread): Getting double* from NumPy array?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
David Broadwell <dbroadwell at mindspring.com> wrote: > Ok, now, what else am i doing that really isn't necessary? > (ie: point out my c hangups, please.) Some minor optimisations: On a Unix system: $ find . -name '*.m3u' -exec cat {} \; > outfile In python: import os.path def all_m3u(outputfile, dirname, names): ext = '' root = '' f = None for name in names: root, ext = os.path.splitext(name) if ext == '.m3u': f = open(os.path.join(dirname, name)) outputfile.write(f.read()) f.close() def doit(dir, outputfile): f = open(outputfile, 'w') os.path.walk(dir, all_m3u, f) f.close() if __name__ == '__main__': doit('.', 'outputfile') Greetings, -- ben . de . rydt at pandora . be ------------------ your comments http://users.pandora.be/bdr/ ------- inl. IPv6, Linux en Pandora
- Previous message (by thread): Now for the flames...
- Next message (by thread): Getting double* from NumPy array?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list