Bill Bumgarner

2004-7-11

Useful python bits.

I haven't disappeared! I have just been incredibly busy with WWDC and related development work. Unfortunately, our stuff hasn't been pushed outside of NDA'd channels, so I can't start swamping my weblog with interesting code snippets related to my day job. I am building up quite the list of "to post" hacks, though.

I have been writing little bits of code to make eliminate repetitive tedium from my world. I'll share what I can. All scripts are available on my public iDisk. Mount http://idisk.mac.com/bbum/Public/ in the Finder or visit my tedious file download page.

First up, if you use Python to bring sanity to shell scripting like tasks (a wonderful thing), then you likely need to execute lots of external commands in a shell like fashion. Process (formerly popen5) is an absolute god-send. It brings total sanity and a bit of security to invoking external commands from within Python:

pkgs = glob.glob('*.pkg')
for pkg in pkgs:
    process.call(['/usr/sbin/installer', '-pkg', pkg, '-target', '/'])

The above being a snippet from a script called bulk-install.py When invoked (typically by sudo python bulk-install.py it installs all pkgs and tarballs in the current working directory (tarballs are just untarred into /).

Just copy the two scripts into a directory, drop any packages and tarballs into the directory and run the script. It is the first thing I run whenever I install a new system. That way, I'm always guranteed to immediately have PyObjC, the Python bsddb and sqlite modules, Subversion, iPhoto, OCUnit, Keynote, the Python documentation and everything else I need regularly.

Comment on this post [ so far] ... more like this: [Python]

Ebay careers: Mac/Linux users need not apply.

Ebay's job search site requires Internet Explorer.

That's kind of pathetic.

A friend noticed this recently and I finally had a chance to check it out. To be fair, I didn't test with IE on the Mac. Maybe it just works? Not that the site gives any indication that IE exists for Macs.

Comment on this post [ so far] ... more like this: [Pathetic] ... topic exchange: [Pathetic]