I miswrote my question. But I still completely understand. What I really wanted to know was whether there was something equivalent to how perl can perform inplace edits of a file with something like the magic $^I variable.
I see from Gabriel that you can use the fileinput module to achieve this. Very cool. And yeah, I think ruby is very perl-like, in that like perl, which looks like someone duct-taped shell, sed, awk and c into a scripting language, ruby duct-taped perl, Smalltalk and Python together. On Thu, May 8, 2008 at 7:49 AM, David <[EMAIL PROTECTED]> wrote: > On Thu, May 8, 2008 at 2:11 PM, Michael Mabin <[EMAIL PROTECTED]> wrote: > > Does python have an equivalent to Perl's inplace-edit variable $^I? > > > > I misread your question. > > No, Python eschews magic characters and symbols. They make code ugly > and harder to read and maintain. > > The first 3 lines of the Zen of Python: > > Beautiful is better than ugly. > Explicit is better than implicit. > Simple is better than complex. > > You might find a variable like that in Ruby, which has strong Perl > influences. > > David. > -- | _ | * | _ | | _ | _ | * | | * | * | * |
-- http://mail.python.org/mailman/listinfo/python-list