[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] This one baffles me



Here's the moral-equivalent one-liner in Python:

print open("myfile.py").read().replace(" "*4, "\t")

Note that sed is your friend, however, and you'd be wise to learn it.

-Casey

On May 17, 2009, at 8:00 AM, Yanom Mobis wrote:

I'm sorry, but that script's complete gibberish to me. I was talking about a python script :)

--- On Sat, 5/16/09, Łukasz Wychrystenko <t0@xxxxxxxxxxxxxxxxx> wrote:

From: Łukasz Wychrystenko <t0@xxxxxxxxxxxxxxxxx>
Subject: Re: [pygame] This one baffles me
To: pygame-users@xxxxxxxx
Date: Saturday, May 16, 2009, 1:55 PM

Dnia Sat, 16 May 2009 11:39:12 -0700 (PDT)
Yanom Mobis <yanom@xxxxxxxxxxxxxx> napisał(a):

> thanks. anyway, how would i write a script that converts all blocks
> of four spaces to tabs?

echo infile | sed /s/"    "/\\t/g ?