Women in Technology

Hear us Roar



Article:
  Using Python and AppleScript Together
Subject:   Shorter alias
Date:   2007-05-10 09:57:22
From:   noahgift
Response to: Shorter alias

I have been abducted by python brainwashing experts and now I always am forced to use the zen of python in everything I do.


I personally like to be explicit as much as possible, but I also like the short cut way too.

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • the zen of python...
    2007-05-11 06:50:44  airdrummer [View]

    also requires the reduction of redundancy: instead of repeating

    app(u'/Applications/DiskWarrior.app')...

    u should declare a variable:

    dw=app('DiskWarrior')
    dw.activate(timeout=3600)
    dw.disk['main'].rebuild(replacing=k.yes_,
    timeout=3600)
    dw.quit(timeout=3600)

    • Noah Gift photo the zen of python...
      2007-05-11 06:59:00  Noah Gift | O'Reilly AuthorO'Reilly Blogger [View]

      That code does look better. Good suggestion! DRY.