On Fri, Jun 17, 2011 at 10:57 AM, Jason Friedman <ja...@powerpull.net> wrote:
> The code behaves as I expect and want, but the de-denting of the
> Python call is unattractive, especially unattractive the longer the
> Python call becomes.  I'd prefer something like:
>

#!/bin/bash
for i in 1 2 3 4; do
  python -c "if True:
      for j in range($i):
          print j
  "
done

Untested, but it's a hack I've used in a few places. The if tells
Python to expect an indent, and nobody cares if your first indent is
two miles and the one after that is only another two spaces.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to